hdu6124--Euler theorem
来源:互联网 发布:人工智能招聘岗位要求 编辑:程序博客网 时间:2024/05/19 05:05
Problem Description
HazelFan is given two positive integersa,b , and he wants to calculate amodb . But now he forgets the value of b and only remember the value of a , please tell him the number of different possible results.
Input
The first line contains a positive integerT(1≤T≤5) , denoting the number of test cases.
For each test case:
A single line contains a positive integera(1≤a≤109) .
For each test case:
A single line contains a positive integer
Output
For each test case:
A single line contains a nonnegative integer, denoting the answer.
A single line contains a nonnegative integer, denoting the answer.
Sample Input
213
Sample Output
23
分析
以为是欧拉,各种打表找规律
mmp写出前10个立刻出结果
就是(a+1)/2+1呵呵
代码
#include<cstdio>#include<iostream>using namespace std;int main(){ int t; scanf("%d",&t); while(t--) { int a; scanf("%d",&a); cout<<(a+1)/2+1<<endl; } return 0;}
链接
阅读全文
0 0
- hdu6124--Euler theorem
- HDU6124 Euler theorem
- HDU6124-Euler theorem
- HDU6124 Euler theorem 签到
- HDU6124-Euler theorem
- hdu6124 Euler theorem -多校联盟7
- hdu6124 Euler theorem 2017多校1005签到题
- Hdu6124 Euler theorem(2017多校第7场)
- Euler theorem(水)
- 杭电 Euler theorem
- HDU 6124 Euler theorem
- hdu 6124 Euler theorem
- HDU 6124-Euler theorem
- HDU 6124-Euler theorem
- hdu 6124 Euler theorem
- HDU 6124 Euler theorem【】
- hdu 6124 Euler theorem
- HDU 6124 Euler theorem
- Could not find class 'com.google.gson.Gson', referenced from method com.example.test.json.JsonUtil.S
- java.lang.IllegalArgumentException: Name for argument type [java.lang.String] not available, and p
- 如何理解字(word)、字节(byte)、比特(bit)
- BI选型的十大参考
- 小易喜欢的数列
- hdu6124--Euler theorem
- 前台js控制字数限制
- 自传播是什么?如何定义?
- 如何快速转载CSDN中的博客
- 安卓登陆的验证与有效期
- Calendar 日期
- Ubuntu Apache重启服务could not reliably determine the server’s fully...
- 原子操作的实现原理
- WebRTC视频Android客户端