A. Again Twenty Five
来源:互联网 发布:java和c语言哪个简单 编辑:程序博客网 时间:2024/05/17 07:15
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, n can 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?
Input
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
Output the last two digits of 5n without spaces between them.
Examples
input
2
output
25
题意: 求5^n最后两位数
#include<iostream>using namespace std;int ksm(__int64 a, __int64 b, __int64 n){ int f = 1; while (b) { if (b % 2 == 1) f = f*a%n; a = a*a%n; b /= 2; } return f;}int main(){ __int64 n; cin >> n; cout << ksm(5, n, 100) << endl; return 0;}
- A. Again Twenty Five
- A. Again Twenty Five!
- A-Again Twenty Five!
- 630A. Again Twenty Five!
- A. Again Twenty Five!【水题】
- Codeforces 630A Again Twenty Five!
- CodeForces - 630A Again Twenty Five! (水)
- Codeforces A. Again Twenty Five!【水】
- CodeForces 630A:Again Twenty Five!【水】
- A - Again Twenty Five!【思维题】
- CodeForces 630A:Again Twenty Five!【水题】
- CodeForces - 630A Again Twenty Five!
- CodeForces-630 A. Again Twenty Five! 【规律】
- 【CodeForces】[630A]Again Twenty Five!
- codeforces 630A Again Twenty Five!
- Again Twenty Five!
- Again Twenty Five!
- CodeForces-630A. Again Twenty Five!【找规律】
- 排序算法(三)——冒泡排序
- sql 重置数据库自增字段
- Android FinalDb使用
- C语言实现单链表逆序与逆序输出实例
- ELK遇到的故障或小难点
- A. Again Twenty Five
- 【网络】多线程--NSThread、GCD、NSOperationQueue
- 20个高级Java面试题汇总
- Objective-C总Runtime的那点事儿(一)消息机制
- 南阳题目25-A Famous Music Composer
- HashMap实现原理分析
- Coin Change
- Handler造成内存泄露解决办法
- 操作系统之内存管理(未完成)