摘要:
A. Everyone Loves to Sleep 思路: 把所有的时间都换成分钟,先记录一下当前的时间,然后依次读入每个闹钟的时间,其中每个闹钟的时间减去现在的时间差值最小的就是答案,注意如果差值小于0说明到第二天了,就要加上24小时 #include <bits/stdc++.h> using 阅读全文
摘要:
A. Optimal Path 思路: 最小就是走第一行和最后一列 #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int, int> PII; const int N = 200010 阅读全文
摘要:
A. XOR Mixup 思路: 因为X是n-1个数的异或,所以这n个数异或起来等于0。所以任意一个数都是其他剩下的数异或起来的值 #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int 阅读全文
摘要:
C. Train and Queries 思路: 开一个map记录一个数字出现的最小坐标和最大坐标 #include <bits/stdc++.h> using namespace std; typedef pair<int, int> PII; const int N = 200010; int 阅读全文
摘要:
A. YES or YES? 思路:algorithm库里有一个transform函数可以将字符串转为大写,然后判断是否等于YES #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int 阅读全文