ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 1615-A
    코드포스 2021. 12. 25. 21:07
     

    Problem - A - Codeforces

     

    codeforces.com

     

    풀이

    n |합 -> 0
    그 외 1

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    #include <bits/stdc++.h>
    #define endl "\n"
    #define ooop(i, n) for(int i = 0; i < n; i++)
    #define loop(i, n) for(int i = 1; i <= n; i++)
    #define all(v) (v).begin(), (v).end()
     
    using namespace std;
    typedef long long ll;
    typedef pair<intint> pi;
    typedef pair<ll, ll> pl;
     
    int main()
    {
        ios::sync_with_stdio(false);
        cin.tie(0), cout.tie(0);
     
        int t;
        cin >> t;
        while(t--){
            int n;
            cin >> n;
            int sum = 0;
            loop(i, n){
                int tmp;
                cin >> tmp;
                sum += tmp;
            }
     
            cout << (sum % n == 001<< endl;
        }
     
        return 0;

    '코드포스' 카테고리의 다른 글

    1615-C  (0) 2021.12.25
    1615-B  (0) 2021.12.25
    1301-B, *1500  (0) 2021.12.24
    1301-C, *1700  (0) 2021.12.24
    1301-D, *2000  (0) 2021.12.24

    댓글

Designed by Tistory.