結果

問題 No.3100 始業式
ユーザー なりきち'なりきち'
提出日時 2023-04-01 00:19:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 921 bytes
コンパイル時間 1,881 ms
コンパイル使用メモリ 175,288 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 10:39:21
合計ジャッジ時間 2,382 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep_S(i,r,n) for(int i = r; i < (n); ++i)
#define Sort(a) sort(a.begin(), a.end())
#define RSort(a) sort(a.rbegin(), a.rend())
#define Output(a) cout << a << endl
 
typedef long long int ll;

typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<string> vst;

const ll INF = 0x1fffffffffffffff;
const ll MOD = 1000000007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }



int main(){
    ll t,n,k;
    cin >> t;
    rep(i,t){
        cin >> n;
        ll ans = 0;
        rep(j,n){
            cin >> k;
            if(k == 1){
                ans++;
            }
        }
        cout << (n - ans + 1) % (n + 1) << "\n";
    }

}
0