随笔分类 -  模拟

摘要:字符串排序II 编写一个程序,将输入字符串中的字符按如下规则排序。 规则 1:英文字母从 A 到 Z 排列,不区分大小写。如,输入:Type 输出:epTy。 规则 2:同一个英文字母的大小写同时存在时,按照输入顺序排列。如,输入:BabA 输出:aABb。 规则 3:非英文字母的其它字符保持原来的 阅读全文
posted @ 2023-03-06 16:31 Keith- 阅读(23) 评论(0) 推荐(0) 编辑
摘要:E. 2584 原题链接 思路 需要注意最后的答案会超过 2584,所以需要多算几项斐波那契数列 小技巧:只需要写一个向左移的函数,别的方向可以先旋转/翻转再向右移然后再转回来 代码 点击查看代码 #include<iostream> #include<cstdio> #include<cstrin 阅读全文
posted @ 2023-03-05 17:39 Keith- 阅读(16) 评论(0) 推荐(0) 编辑
摘要:B. Rule 110 原题链接 题意 模拟转换字符串 题解 Rule 110 是一个著名的元胞自动机规则,它被认为是最简单的图灵完备系统。 这个题要我们模拟这个系统,按照题意做即可,注意开头结尾要补充 0。 代码 点击查看代码 #include<iostream> #include<cstdio> 阅读全文
posted @ 2023-03-05 14:57 Keith- 阅读(30) 评论(0) 推荐(0) 编辑
摘要:K 小沙の抱团 easy 原题链接 思路 代码 点击查看代码 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<que 阅读全文
posted @ 2023-02-01 22:42 Keith- 阅读(14) 评论(0) 推荐(0) 编辑
摘要:H 小沙の店铺 原题链接 代码 点击查看代码 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<queue> usin 阅读全文
posted @ 2023-02-01 22:34 Keith- 阅读(14) 评论(0) 推荐(0) 编辑
摘要:G 清楚姐姐逛街(Easy Version) 原题链接 题意 终点会按照固定方式移动的搜索问题,多次查询 思路 只要时间t是确定的,那么终点的位置就是确定的 -> 可以模拟每一时刻 bfs维护智乃到每个点的最短距离 模拟每一时刻清楚姐姐的位置 如果该时刻大于智乃到每个点的最短距离(前提是智乃能够到达 阅读全文
posted @ 2023-02-01 01:27 Keith- 阅读(32) 评论(0) 推荐(0) 编辑
摘要:E 清楚姐姐打怪升级 原题链接 代码 点击查看代码 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<queue> u 阅读全文
posted @ 2023-01-31 20:56 Keith- 阅读(31) 评论(0) 推荐(0) 编辑
摘要:A.World Final? World Cup! (I) 原题链接 题意 AB两队ABABABABAB形式轮流罚球共10次,给出01串代表每次罚球的结果,问是否能在第x球后知道比赛结果,能则输出x,若10轮内没有分出胜负则输出-1 思路 胜利条件:胜球数多 如果第x球后就知道比赛结果,获胜的一队的 阅读全文
posted @ 2023-01-18 17:16 Keith- 阅读(30) 评论(0) 推荐(0) 编辑
摘要:纸张尺寸 在 ISO 国际标准中定义了 A0 纸张的大小为 1189mm×841mm,将 A0 纸沿长边对折后为 A1 纸,大小为 841mm×594mm ,在对折的过程中长度直接取下整(实际裁剪时可能有损耗)。 将 A1 纸沿长边对折后为 A2 纸,依此类推。 输入纸张 阅读全文
posted @ 2023-01-07 12:20 Keith- 阅读(170) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<stdio.h> double g,j,ga; int ans; int main(){ scanf("%lf",&g);scanf("%lf",&j); ga = g; ans = 1; while(ga > j){ ga += g * 0.1; j += j * 阅读全文
posted @ 2023-01-03 17:21 Keith- 阅读(24) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<stdio.h> int cnt[10]; int op; int main(){ while(1){ scanf("%d",&op); if(!op)break; if(op < 20220 || op > 20229){puts("凭证无效");continue; 阅读全文
posted @ 2023-01-03 16:26 Keith- 阅读(31) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示