http://codeforces.com/problemset/problem/630/A
The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" — the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, ncan be rather big, and one cannot find the power using a calculator, but we need people who are able to think, not just follow the instructions."
Could you pass the interview in the machine vision company in IT City?
The only line of the input contains a single integer n (2 ≤ n ≤ 2·1018) — the power in which you need to raise number 5.
Output the last two digits of 5n without spaces between them.
2
25
题意:
找出 5^n 次方的后两位。
思路:
找规律吧,慢慢手写也行。
AC code:
#include<stdio.h>
#include<cstring>
#include<algorithm>
#define AC main()
using namespace std;
const int MYDD = 1103;
int AC {
int n;
scanf("%d", &n);
if(n == 1) {
puts("5");
} else{
puts("25");
}
return 0;
}

博客介绍了CodeForces的一道题目,要求求出5的n次方的最后两位数字。内容涉及解题思路和通过的代码,主要考察数学和找规律的能力。
609

被折叠的 条评论
为什么被折叠?



