随笔分类 -  模拟

摘要:problem保持队形(我们认为只要这一句内含有且恰好含有一次@,@的人和上一句话一样就算为队形)若艾特的人与第一个人不同,就算队形被打破,油炸失败。若这个人在队形被打破之前出来吱声了,或者就是他打破队形了,就算(油)炸成功了。若(油)炸成功,输出“Successfu... 阅读全文
posted @ 2018-07-28 12:03 gwj1139177410 阅读(157) 评论(0) 推荐(0)
摘要:problememm,大致这样,不过还是有点,,解释不清楚。给定一个n行m列的网格,每格有一个价值。从第一行的任意一个格子开始,每次跳到(多次转移)剩余格子中价值最大的那个并获得价值。相邻格子转移代价为1,每次转移只能到相邻四个格子。求总代价为k的情况下能获得多少价值... 阅读全文
posted @ 2018-07-24 09:00 gwj1139177410 阅读(192) 评论(0) 推荐(0)
摘要:problemn个图书编号,q个需求码。(都是数字)求满足所有包含需求码后缀的图书编号的最小值。n,q#includeusing namespace std;const int pow[] = {1,10,100,1000,10000,100000,1000000,1... 阅读全文
posted @ 2018-07-23 21:37 gwj1139177410 阅读(189) 评论(0) 推荐(0)
摘要:problem题意:有n个人,每个人接水wi有m个水龙头,每个水龙头每秒供水1求n个人接完水要多少时间注意:人按编号1~n接水(坑点,顺序确定)换人过程没有浪费n #include#includeusing namespace std;const int maxn =... 阅读全文
posted @ 2018-07-23 09:44 gwj1139177410 阅读(148) 评论(0) 推荐(0)
摘要:problem骑士在连续的N天里每天收到N枚金币,骑士会在之后的连续 N+1 天里,每天收到 N+1 枚金币。求骑士在前K天里一共收到了多少金币solution直接模拟死循环n天。codes#include#includeusing namespace std;int... 阅读全文
posted @ 2018-07-07 15:24 gwj1139177410 阅读(155) 评论(0) 推荐(0)
摘要:problem给你3种组合,每种有x只笔和售价y元。选择1种组合,使得买n支笔的总消费最少。求总消费。solution我还是太天真了,,,第一眼看过去背包。。。 然而,题目告诉我们P老师决定只买同一种包装的铅笔!算的时候注意向上取整(不足5包要当5包算codes#in... 阅读全文
posted @ 2018-07-07 14:59 gwj1139177410 阅读(128) 评论(0) 推荐(0)
摘要:problem已知正整数 n 是两个不同的质数的乘积试求出两者中较大的那个质数solution2个质数,所以没必要分解质因数。直接枚举,遇到小的一个因数,拿他除一下就是答案了。codes#includeusing namespace std;int main(){ ... 阅读全文
posted @ 2018-07-07 14:42 gwj1139177410 阅读(137) 评论(0) 推荐(0)
摘要:problem给你三个数A,B,C求A*0.2+B*0.3+C*0.5的值。solution这不是语法题吗我都要不好意思出来发文章了codes#includeusing namespace std;int main(){ int A, B, C; cin>... 阅读全文
posted @ 2018-07-07 14:38 gwj1139177410 阅读(111) 评论(0) 推荐(0)
摘要:problem请统计某个给定范围 [L, R] 的所有整数中,数字 2 出现的次数。例如2~22中2出现了6次solution枚举L~R对于i分离它的每一位,判断是否为2,累加答案。codes#includeusing namespace std;int main()... 阅读全文
posted @ 2018-07-07 14:16 gwj1139177410 阅读(140) 评论(0) 推荐(0)
摘要:problemsolutioncodes#includeusing namespace std;int a[10010], b[10010], g[10010], k[10010];int main(){ int n; cin>>n; for(int i... 阅读全文
posted @ 2018-06-08 22:10 gwj1139177410 阅读(105) 评论(0) 推荐(0)
摘要:problem给定一个n进制的数m每次进行如下操作:反转(比如把56变成65)后两数相加,得新数。求最少经过几步可以得到新数为回文数,超过30步输出Impossible!solution判断回文或者反转一个数可以用STL的reverse。两n进制数相加模拟高精即可(竖... 阅读全文
posted @ 2018-06-07 22:09 gwj1139177410 阅读(271) 评论(0) 推荐(0)
摘要:problem给定数字n(using namespace std;int main(){ int n, x, ans = 0; cin>>n>>x; for(int i = 1; i 0){ if(t%10==x)ans++; t/=10;} }... 阅读全文
posted @ 2018-06-07 21:03 gwj1139177410 阅读(158) 评论(0) 推荐(0)
摘要:problemsolutioncodes#includeusing namespace std;int a[100010], ans;int main(){ int l, m; cin>>l>>m; for(int i = 0; i >x>>y; ... 阅读全文
posted @ 2018-06-07 15:25 gwj1139177410 阅读(106) 评论(0) 推荐(0)
摘要:problem给你10个数和一个h如果h+30>=a[i],答案就累加1solution直接模拟当然你也可以splaycodes#includeusing namespace std;int a[10], h, ans;int main(){ for(int i... 阅读全文
posted @ 2018-06-07 14:49 gwj1139177410 阅读(125) 评论(0) 推荐(0)
摘要:problemsolutioncodes#include#includeusing namespace std;int ans;int main(){ string str; cin>>str; for(int i = 0, j = 1; i < 12;... 阅读全文
posted @ 2018-06-06 21:41 gwj1139177410 阅读(138) 评论(0) 推荐(0)
摘要:problemsolutioncodes//模拟即可#include#includeusing namespace std;struct node{ int id, ch, score; bool operator x.score; if(... 阅读全文
posted @ 2018-06-05 21:27 gwj1139177410 阅读(104) 评论(0) 推荐(0)
摘要:problemsolutioncodes#include#include#includeusing namespace std;const string num[] = { "zero","one","two","three","four","five", "s... 阅读全文
posted @ 2018-06-05 21:23 gwj1139177410 阅读(78) 评论(0) 推荐(0)
摘要:problemsolutioncodes//巧妙的利用了x-=min(x,t); x若剩余为0则下面升温也为0#include#includeusing namespace std;typedef long long LL;int main(){ LL a, c... 阅读全文
posted @ 2018-06-04 21:45 gwj1139177410 阅读(144) 评论(0) 推荐(0)
摘要:problemsolutioncodes#includeint n, a[(int)1e5+10];int readint(){ int op=1,x=0; char ch=getchar(); while(ch'9'){if(ch=='-')op=-1;... 阅读全文
posted @ 2018-06-04 21:42 gwj1139177410 阅读(111) 评论(0) 推荐(0)
摘要:problemsolutioncodes#include#includeusing namespace std;int main(){ int n; string s; cin>>s>>n; for(int i = 0; i pos)pos ... 阅读全文
posted @ 2018-06-03 10:50 gwj1139177410 阅读(228) 评论(0) 推荐(0)

选择