暴力/模拟
文章平均质量分 54
北里五井
这个作者很懒,什么都没留下…
展开
-
Uva725
#include<iostream> using namespace std; int a[10];//用来记录使用过的数字;用过赋值为1 int ans; void init() { for(int i=0;i<10;i++) { a[i]=0; } ans=0; } int Jud...原创 2018-03-12 11:26:07 · 671 阅读 · 3 评论 -
牛客小白月赛5 - j - 时间time
链接:https://www.nowcoder.com/acm/contest/135/J 来源:牛客网 Apojacsleam是一个喜欢特殊时刻的人。 他定义了一个时刻,若电子表显示ab:ba(24小时制),则该时刻为“回文时刻”(可以有前导零)。例如00:00就是回文时刻。 给定一个时刻,求此时刻的上一个和下一个回文时刻。 J题附加:00:00就是...原创 2018-07-24 09:50:27 · 139 阅读 · 0 评论 -
NYOJ - 1221 - 盗梦空间【模拟】
题目描述《盗梦空间》是一部精彩的影片,在这部电影里,Cobb等人可以进入梦境之中,梦境里的时间会比现实中的时间过得快得多,这里假设现实中的3分钟,在梦里就是1小时。然而,Cobb他们利用强效镇静剂,可以从第一层梦境进入第二层梦境,甚至进入三层,四层梦境,每层梦境都会产生同样的时间加速效果。那么现在给你Cobb在各层梦境中经历的时间,你能算出现实世界过了多长时间吗?比如,Cobb先在第一层梦境待了1...原创 2018-06-29 10:37:54 · 186 阅读 · 0 评论 -
codeforces - 1005B - Delete from the Left【模拟】
题意:两个字符串,输出需要删除多少个字符使两个字符串相等,只能从当前左的字符开始删除;题解:计算两个字符串从右往左有多少个字符相等,不相等的字符为需要删除;#include <bits/stdc++.h> using namespace std; const int maxn = 222222; char a[maxn], b[maxn]; int main() { scanf...原创 2018-07-11 11:25:51 · 171 阅读 · 0 评论 -
Codeforces - 1005A - Tanya and Stairways【模拟】
题意:Tanya爬楼梯,每爬一层楼就会说出这一层楼梯的编号;例如她爬上两层楼,其中第一个楼包含3个楼梯3,第二个包含44个,她说出的数字为1 ,2 ,3 ,1 ,2 ,3 ,4,输出Tanya爬了几层楼,每一层楼有多少楼梯。 题解:用Vector存储每一层楼的楼梯数; #include <bits/stdc++.h> using namespace std; vector ...原创 2018-07-11 11:11:10 · 372 阅读 · 0 评论 -
Codeforce -990A【模拟】
A. Commentary Boxestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBerland Football Cup starts really soon! Commentators from all over the world c...原创 2018-06-10 21:10:23 · 292 阅读 · 0 评论 -
HihoCoder - 1700【模拟】
在CSS中我们可以用井号(#)加6位十六进制数表示一种颜色,例如#000000是黑色,#ff0000是红色,#ffd700是金色。 同时也可以将六位颜色#RRGGBB简写为#RGB三位颜色。例如#000与#000000是相同的,#f00与#ff0000是相同的,#639与#663399是相同的。 对于两个颜色#abcdef和#ghijkl,我们定义其距离是(ab - gh)2 + (cd - ...原创 2018-04-07 14:39:33 · 271 阅读 · 0 评论 -
Codeforces - 988B-Substrings Sort【排序+string::find】
B. Substrings Sorttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given nn strings. Each string consists of lowercase English letters. Rear...原创 2018-06-04 20:28:54 · 282 阅读 · 0 评论 -
Codeforces - 988A - Diverse Team【map】
A. Diverse Teamtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are nn students in a school class, the rating of the ii-th student on Codehors...原创 2018-06-04 20:20:09 · 288 阅读 · 0 评论 -
NYOJ - 1099 - 括号配对问题
题目描述 现在,有一行括号序列,请你检查这行括号是否配对。 输入 第一行输入一个数N(0 < N <=100),表示有N组测试数据。后面的N行输入多组输入数据,每组输入数据都是一个字符串S(S的长度小于10000,且S不是空串),测试数据组数少于5组。数据保证S中只含有”[“,”]”,”(“,”)”四种字符 输出 每组输入数据的输出占一行,如果该字符串中所含的括号是配对的,...原创 2018-06-11 14:24:10 · 111 阅读 · 0 评论 -
Codeforces - 990B【Vector模拟】
B. Micro-Worldtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have a Petri dish with bacteria and you are preparing to dive into the harsh mic...原创 2018-06-11 10:54:15 · 289 阅读 · 0 评论 -
Codeforces - 1005C - Summarize to the Power of Two【map】
题意:给你一个序列,对于序列中的元素 i 如果存在 j 满足i + j (i ≠ j)的值为2的幂则保留,否则将其删除;输出需要删除的个数。 #include<bits/stdc++.h> using namespace std; const int maxn = 122222; map<int,int>mp; int a[maxn]; int main() { ...原创 2018-07-20 08:43:09 · 141 阅读 · 0 评论