题目描述
思路
合法的n是一个区间,可以分成两次求,二分n的范围。注意有一些关于long long和代码的细节,这个checker还是很好写的
阅读全文SIGSLEEP Fellow
原题地址:Codeforces
题意:判断回文时间。
先搞出来一个判断回文的函数,然后枚举分钟。
阅读全文注意到$a,b\leq 60$,所以预处理出所有$x^a,y^b$存起来,然后两两求和,去重, 然后处理一下得到答案。
开unsigned long long
while (num <= 1e18)
num = num * x
这样写是不符合基本法的,会溢出掉的
阅读全文问题:题目地址
Vladik often travels by trains. He remembered some of his trips especially well and I would like to tell you about one of these trips:
Vladik is at initial train station, and now n people (including Vladik) want to get on the train. They are already lined up in some order, and for each of them the city code $a_i$ is known (the code of the city in which they are going to).