hdu 6124 Euler theorem (多校联赛)
来源:互联网 发布:java项目视频20套 编辑:程序博客网 时间:2024/06/05 22:48
Euler theorem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0
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
这场比赛里最简单的题目 我以为是数论 就扔给了队友 结果队友wr了两次 后来一看就是一道简单的思维题 忍不住很很的吐槽一波队友O__O "…
ac代码:
#include<cstdio>#include<iostream>using namespace std;int main(){ int t; cin>>t; int n; while(t--) { scanf("%d",&n); if(n==1) cout<<2<<endl; if(n==2) cout<<3<<endl; if(n!=1&&n!=2) { if(n&1) { cout<<(n+1)/2+1<<endl; } else { cout<<n/2+1<<endl; } } } return 0;}
阅读全文
0 0
- hdu 6124 Euler theorem (多校联赛)
- 17暑假多校联赛7.5 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
- hdu-6124-Euler theorem(多校训练)
- hdu 6124 Euler theorem(水题)
- HDU 6124 Euler theorem(水+思维)
- HDU 6124 Euler theorem(数论)
- HDU 6124 Euler theorem(思维)
- hdu 6124.Euler theorem
- lightoj 1259 Goldbach`s Conjecture
- CSS3多列布局(columns)的用法
- 标签设置小手
- 算法学习笔记4-动态规划-背包问题
- Nginx 配置文件 nginx.conf 详解
- hdu 6124 Euler theorem (多校联赛)
- 欢迎使用CSDN-markdown编辑器
- Web前端学习路线与学习方式
- SDCardUtils
- 了解Nginx HTTP代理、负载均衡、缓冲和缓存
- C# TreeView从数据库绑定数据
- 37对象7---location
- 非制冷式红外探测器原理研究(课题总结论文)
- 剑指offer59对称的二叉树