2017杭电多校第七场1005 Euler theorem(勉强数论)HDU 6124
来源:互联网 发布:轩辕剑披风进阶数据 编辑:程序博客网 时间:2024/04/30 19:43
Euler theorem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 518 Accepted Submission(s): 415
Problem Description
HazelFan is given two positive integers a,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 integer T(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
Source
2017 Multi-University Training Contest - Team 7
Recommend
liuyiding | We have carefully selected several similar problems for you: 6132 6131 6130 6129 6128
题目大意:给你 a ,问 a 对所有数取模后的所有结果有多少个。
解题思路:每一个数取模能得到的数就是0~( a + 1 )/2加上它本身.
AC代码:
#include<iostream>#include<cstdio>using namespace std;int main(){int t;scanf("%d",&t);while(t--){int a;scanf("%d",&a);int ans;if(a%2==0)ans=a/2+1;else ans=a/2+2;printf("%d\n",ans);}return 0;}
阅读全文
0 0
- 2017杭电多校第七场1005 Euler theorem(勉强数论)HDU 6124
- 2017杭电多校第七场1005Euler theorem
- HDU 6124 Euler theorem(数论)
- Euler theorem(HDU 6124)
- 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
- HDU 6124 Euler theorem
- 2017杭电多校第六场 1011 (勉强算容斥吧)HDU 6106
- hdu 6124 Euler theorem(水题)
- HDU 6124 Euler theorem(水+思维)
- Hdu6124 Euler theorem(2017多校第7场)
- HDU 6124 Euler theorem(思维)
- B-Tree索引及索引优化策略
- snv服务器的安装
- 【01】MFC 学习
- 电商及竞品分析
- MyBatis批量插入数据
- 2017杭电多校第七场1005 Euler theorem(勉强数论)HDU 6124
- IO复用——select函数应用实例
- LeetCode刷题(C++)——Course Schedule
- 使用不同方法拷贝字节流文件的速度测试
- HDU
- spring 定时任务 Scheduled
- WUSTOJ
- 大数据项目架构思考(一)
- 无权二分匹配——匈牙利算法