您的位置:首页 > 大数据 > 人工智能

2017 Multi-University Training Contest - Team 7 1005 Euler theorem

2017-08-15 20:12 561 查看

Euler theorem

[align=center]Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 132    Accepted Submission(s): 114
[/align]

[align=left]Problem Description[/align]

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.
 

[align=left]Input[/align]

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 integer a
(1≤a≤10 
  9 
).
 

[align=left]Output[/align]

For each test case:

A single line contains a nonnegative integer, denoting the answer.

 

[align=left]Sample Input[/align]

2
1
3

 

[align=left]Sample Output[/align]

2
3

 <
4000
/span>
找规律题
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
std::ios::sync_with_stdio(0);
int T;
cin >> T;
while (T--)
{
ll n;
cin >> n;
cout << (ll)(2 + (n + 1) / 2 - 1) << endl;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  hdu 多校 找规律
相关文章推荐