Experimental Educational Round: VolBIT Formulas Blitz A
Description
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?
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
实际上,结果就是25,不放心可以用快速幂取模
#include<stdio.h>
//#include<bits/stdc++.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<sstream>
#include<set>
#include<queue>
#include<map>
#include<vector>
#include<algorithm>
#include<limits.h>
#define inf 0x7fffffff
#define INF 0x7fffffffffffffff
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define ULL unsigned long long
using namespace std;
LL modl(LL a, LL b, LL c) //快速幂取余a^b%c
{
LL res, t;
res = 1 % c;
t = a % c;
while (b)
{
if (b & 1)
{
res = res * t % c;
}
t = t * t % c;
b >>= 1;
}
return res;
}
int main()
{
LL n;
cin>>n;
cout<<modl(5,n,100);
return 0;
}
Experimental Educational Round: VolBIT Formulas Blitz A的更多相关文章
- Experimental Educational Round: VolBIT Formulas Blitz
cf的一次数学场... 递推 C 题意:长度<=n的数只含有7或8的个数 分析:每一位都有2种可能,累加不同长度的方案数就是总方案数 组合 G 题意:将5个苹果和3个梨放进n个不同的盒子里的方案 ...
- Experimental Educational Round: VolBIT Formulas Blitz K
Description IT City company developing computer games decided to upgrade its way to reward its emplo ...
- Experimental Educational Round: VolBIT Formulas Blitz N
Description The Department of economic development of IT City created a model of city development ti ...
- Experimental Educational Round: VolBIT Formulas Blitz J
Description IT City company developing computer games invented a new way to reward its employees. Af ...
- Experimental Educational Round: VolBIT Formulas Blitz F
Description One company of IT City decided to create a group of innovative developments consisting f ...
- Experimental Educational Round: VolBIT Formulas Blitz D
Description After a probationary period in the game development company of IT City Petya was include ...
- Experimental Educational Round: VolBIT Formulas Blitz C
Description The numbers of all offices in the new building of the Tax Office of IT City will have lu ...
- Experimental Educational Round: VolBIT Formulas Blitz B
Description The city administration of IT City decided to fix up a symbol of scientific and technica ...
- Experimental Educational Round: VolBIT Formulas Blitz K. Indivisibility —— 容斥原理
题目链接:http://codeforces.com/contest/630/problem/K K. Indivisibility time limit per test 0.5 seconds m ...
随机推荐
- re 模块 常用正则表达式符号 最常用的匹配语法
常用正则表达式符号1 '.' 默认匹配除\n之外的任意一个字符,若指定flag DOTALL,则匹配任意字符,包括换行 '^' 匹配字符开头,若指定flags MULTILINE, ...
- HBase 协处理器统计行数
环境:cdh5.1.0 启用协处理器方法1. 启用协处理器 Aggregation(Enable Coprocessor Aggregation) 我们有两个方法:1.启动全局aggregation, ...
- LVM扩展学习日志
lvm是逻辑卷管理的简称,它将一个或多个物理硬盘分区(PV)组成一个逻辑硬盘(VG)来使用, 然后从这个VG中划分出逻辑分区(LV), 以上概念是我理解的东西,可能和书上的不一样. 以下所有命令都是 ...
- SSH框架(四) struts2+spring3.0的登陆示例
(一)关键理念及需要注意的地方: 使用struts2+spring3.0的框架搭建web程序,就是使用spring来进行依赖注入(依赖注入请参考baidu上面的解释:http://baike.baid ...
- CodeForces 141C Queue (构造)
题意:n 个人在排队,然后给出每个人的前面比他身高高的人的数量hi,让你给出一种排列,并给出一种解. 析:首先,hi 小的要在前面,所以先进行排序,然后第一个人的 h1 必须为0,我们可以令身高为 1 ...
- AR# 30522:LogiCORE RapidIO - How do system_reset and link_reset work?
Description How do system_reset and link_rest work? Solution lnk_linkreset_n (input): In Xilinx SRIO ...
- VS2012,更新补丁后--创建项目未找到与约束匹配的导出
更新过一次漏洞,后来尝试建立一个项目,结果错误终于暴露了,创建项目时无法成功创建,而且提示:未找到与约束ontractNameMicrosoft.VisualStudio.Text.ITextDocu ...
- 【IMOOC学习笔记】多种多样的App主界面Tab实现方法(二)
Fragment实现Tab 首先把activity_main.xml 文件中的ViewPager标签改成Fragment标签 <FrameLayout android:id="@+id ...
- Dubbo项目入门
Dubbo是一款高性能.轻量级的开源Java RPC框架,它提供了三大核心能力:面向接口的远程方法调用,智能容错和负载均衡,以及服务自动注册和发现. 它的特性如下 面向接口代理的高性能RPC调用 智能 ...
- 实现基于dotnetcore的扫一扫登录功能
第一次写博客,前几天看到.netcore的认证,就心血来潮想实现一下基于netcore的一个扫一扫的功能,实现思路构思大概是web端通过cookie认证进行授权,手机端通过jwt授权,web端登录界面 ...