
模拟
文章平均质量分 60
Joey丶sunk
古今成大事者 不惟有超世之才 亦必有坚忍不拔之志
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
UVALive - 7000 Present Problem 简单模拟
别看了,每一列保存 排序,upper_bound 降复杂度 慢慢写吧 #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long lon原创 2017-10-29 20:23:48 · 391 阅读 · 0 评论 -
Gym - 101611H Hilarious Cooking 思路+模拟 2017-2018 ACM-ICPC, NEERC, Moscow Subregional Contest
题意: 假定有一串数字,给定限定的一些位置的数字,然后每相邻两个数字的差值最大是1,可以相等,所有的数字最小是0,没有上限 问所有的数字加和能否等于给定的另一个数t 思路: 首先如果们能确定整个序列能构成的数的最小值和最大值就可以得到答案了,当然,还要判断所给定的若干个数是否冲突 再求能够组成的数的上下界时,最大的数好求,就下界是要注意减少到0不再减小 #include<...原创 2018-09-25 20:21:07 · 376 阅读 · 0 评论 -
Aizu - 1384 Rendezvous on a Tetrahedron 思路+模拟
题意: 略 思路: 待更 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <set> #include <vector> #include <bitset> #i原创 2018-08-28 13:00:00 · 360 阅读 · 0 评论 -
HDU-6396 Swordsman nlogn模拟?暴力?
慢走 不送 写的真滴捞!!! 留下做纪念 按照每个魔法类型,分别用不同的数组保存并排序,根据当前各类型魔法值选择相应的合法的魔法类型标记 这是On复杂度,前面排序需要O(nlogn)复杂度 #include <iostream> #include <algorithm> #include <cstdio> #include &l...原创 2018-08-13 19:32:21 · 150 阅读 · 0 评论 -
HDU-6396 Swordsman nlogn模拟?暴力?
主代码请空降至422行 题意: 略; 思路: k不大,建立k+1个数组,分别按照每个魔法属性排序,设置相应的指针,表示小于 当前猎人拥有的对应魔法属性的 位置,分别跑On,记录并处理; 比上一个写法好多了; #include <iostream> #include <algorithm> #include <cstdio> #include ...原创 2018-08-14 10:01:10 · 136 阅读 · 0 评论 -
SGU - 444 Headstrong Student 模拟+循环节
题意: 求 a / b 的小数点后的循环节的开始点和循环节长度 至于整数,循环节长度为0,开始位置就是整除完了的后一位 思路: 直接模拟,出现重复的余数,说明出现了循环节,如果被整除了的话直接输出 本来看错数据大小了,用的 map 记录余数的位置,748ms 卡过,后来发现只有1e6 的数据,用数组记录就好了; #include #include #include #i原创 2017-11-27 20:07:37 · 223 阅读 · 0 评论 -
Codeforces 903B - The Modcrab 模拟+记录
模拟过程并记录 #include #include #include #include #include #include #include #include #include #include #include #define PI acos(-1.0) #define in freopen("in.txt", "r", stdin) #define out freopen("out.原创 2017-12-14 13:25:37 · 543 阅读 · 0 评论 -
ZOJ - 3954 Seven-Segment Display 相对位置-模拟
题意: 改变列的相对位置,看看新的行列式是否合法 思路: 只要如果合法的话,每一列的中各行的相对位置的数对应都是不变的,,也就是我们只需要看改变前后时候存在相同的序列就是了 #include #include #include #include #include #include #include #include #include #include #include #d原创 2017-12-03 22:21:43 · 253 阅读 · 0 评论 -
ZOJ - 3950 How Many Nines 年份大模拟
大模拟 大体思路: 给定 y1:m1:d1 ~ y2:m2:d2, 可以分为三个阶段,分别计算: ① y1+1 ~ y2-1 这其中的整年份可以直接算出来:打表预处理 ② y1:m1:d1 ~ y1年年末; 多少个月,多少天,分别考虑 ③ y2年年初 ~ y2:m2:d2; == 闰年的关系处理清楚就行了; #include #include #incl原创 2017-12-03 19:52:44 · 353 阅读 · 0 评论 -
Codeforces Round #555 (Div. 3) C2 - Increasing Subsequence (hard version) 贪心模拟
类似于C1,从两边先选小的, 如果一样大的话,那接下来选的只能是某一边连续的一段, 这样的话分别从两边开始选,最后看哪个结果最优 注意判断是否合法 #include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; const int maxn = ...原创 2019-05-01 17:05:53 · 383 阅读 · 0 评论