
模拟
AliceBuJu
这个作者很懒,什么都没留下…
展开
-
【NOIP】玩具谜题
模拟水题。 (当前位置+跨越人数)%总人数=下一个位置 PS:因为取模,所以要把第一个人的位置设为0(而不是1)#include<cstdio>#include<iostream>#include<cstring>#include<cmath>using namespace std;const int maxn=100000+5;struct peo{ int dir;原创 2017-10-09 09:39:29 · 281 阅读 · 0 评论 -
【NOIP】选择客栈
Loi_cgold的详细解释#include<cstdio>#include<iostream>#include<cstring>using namespace std;const int maxn=200000;int tot[maxn],sum[maxn],h[maxn];int n,k,p;//分别表示客栈的个数,色调的数目和能接受的最低消费的最高值int ans,now;in原创 2017-10-19 06:50:25 · 577 阅读 · 0 评论 -
爬楼梯
题目描述 众所周知, wyh 是一名高二党,正把自己投入到学奥赛这一热火 朝天的工作中。 在一个天高云淡、风和日丽的下午,你和神犇 wyh 又缓缓向着 机房走去。 正当你准备上楼梯时, wyh 突发奇想, 提出了一个问 题: 如果他一次能迈一阶台阶乃至多阶,那么他走到四楼一共有 多少种可能的方案。 wyh 比较懒, 因此他还想知道他最少需要抬多 少次腿(无论一次走几阶楼梯都算抬一次腿原创 2017-10-19 09:12:41 · 254 阅读 · 0 评论 -
【codevs 2178】表达式运算Cuties
一下午的成果???//遇到优先级小于栈顶时计算#include<cstdio>#include<iostream>#include<algorithm>#include<cmath>#include<stack>#include<cstring>#define ll long longusing namespace std;stack<ll>num;stack<char>f;l原创 2017-10-25 18:02:21 · 390 阅读 · 1 评论