zoukankan      html  css  js  c++  java
  • B

    直接打表找规律

    HazelFan is given two positive integers a,ba,b, and he wants to calculate amodbamodb. But now he forgets the value of bb and only remember the value of aa, please tell him the number of different possible results.

    InputThe first line contains a positive integer T(1T5)T(1≤T≤5), denoting the number of test cases. 
    For each test case: 
    A single line contains a positive integer a(1a109)a(1≤a≤109).
    OutputFor each test case: 
    A single line contains a nonnegative integer, denoting the answer. 
    Sample Input

    2
    1
    3

    Sample Output

    2
    3
    #include<iostream>
    #include<cstdio>
    #include<cmath>
    #include<cstring>
    #include<sstream>
    #include<algorithm>
    #include<queue>
    #include<deque>
    #include<iomanip>
    #include<vector>
    #include<cmath>
    #include<map>
    #include<stack>
    #include<set>
    #include<memory>
    #include<list>
    #include<string>
    using namespace std;
    typedef long long LL;
    typedef unsigned long long ULL;
    #define MAXN  1009
    #define L 31
    #define INF 1000000009
    #define eps 0.00000001
    
    LL n;
    int main()
    {
        int T;
        scanf("%d", &T);
        while (T--)
        {
            scanf("%lld", &n);
            if (n & 1)
                n++;
            printf("%lld
    ", n / 2 + 1);
        }
    }
  • 相关阅读:
    Word pair Hu
    [bzoj1601] 灌水
    小木棍
    雇佣计划
    [Luogu1282] 多米诺骨牌
    [Luogu1216] 数字三角形
    [Luogu1734] 最大约数和
    [NOIp2008] 传纸条
    [Luogu1325] 雷达安装
    nginx
  • 原文地址:https://www.cnblogs.com/joeylee97/p/7395316.html
Copyright © 2011-2022 走看看