結果

問題 No.1665 quotient replace
ユーザー nawawannawawan
提出日時 2021-09-03 21:45:22
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2,172 ms / 3,000 ms
コード長 750 bytes
コンパイル時間 2,281 ms
コンパイル使用メモリ 205,356 KB
実行使用メモリ 100,904 KB
最終ジャッジ日時 2023-08-21 20:58:23
合計ジャッジ時間 94,662 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,931 ms
92,920 KB
testcase_01 AC 1,938 ms
92,800 KB
testcase_02 AC 1,912 ms
92,748 KB
testcase_03 AC 1,950 ms
92,756 KB
testcase_04 AC 1,946 ms
92,740 KB
testcase_05 AC 1,945 ms
92,848 KB
testcase_06 AC 1,984 ms
92,908 KB
testcase_07 AC 1,980 ms
92,868 KB
testcase_08 AC 1,954 ms
92,740 KB
testcase_09 AC 1,935 ms
93,124 KB
testcase_10 AC 2,047 ms
95,560 KB
testcase_11 AC 2,135 ms
98,672 KB
testcase_12 AC 1,894 ms
93,712 KB
testcase_13 AC 2,170 ms
100,904 KB
testcase_14 AC 2,138 ms
100,692 KB
testcase_15 AC 2,143 ms
100,836 KB
testcase_16 AC 2,164 ms
100,600 KB
testcase_17 AC 2,172 ms
100,888 KB
testcase_18 AC 1,874 ms
92,808 KB
testcase_19 AC 1,847 ms
92,756 KB
testcase_20 AC 1,882 ms
92,756 KB
testcase_21 AC 1,886 ms
92,904 KB
testcase_22 AC 1,894 ms
92,756 KB
testcase_23 AC 1,898 ms
92,748 KB
testcase_24 AC 1,939 ms
92,844 KB
testcase_25 AC 1,947 ms
93,096 KB
testcase_26 AC 1,899 ms
92,792 KB
testcase_27 AC 1,926 ms
92,812 KB
testcase_28 AC 1,940 ms
93,020 KB
testcase_29 AC 1,935 ms
93,384 KB
testcase_30 AC 2,163 ms
96,680 KB
testcase_31 AC 2,124 ms
98,996 KB
testcase_32 AC 2,113 ms
98,720 KB
testcase_33 AC 1,969 ms
94,916 KB
testcase_34 AC 2,069 ms
97,480 KB
testcase_35 AC 2,139 ms
96,896 KB
testcase_36 AC 2,081 ms
97,272 KB
testcase_37 AC 2,080 ms
96,664 KB
testcase_38 AC 2,093 ms
97,792 KB
testcase_39 AC 2,026 ms
96,176 KB
testcase_40 AC 2,018 ms
96,216 KB
testcase_41 AC 2,016 ms
96,232 KB
testcase_42 AC 1,883 ms
92,868 KB
testcase_43 AC 1,924 ms
93,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<long long> A(N);
    for(int i = 0; i < N; i++) cin >> A[i];
    vector<vector<bool>> used(1000010, vector<bool>(200, false));
    vector<int> gr(1000010);
    for(int i = 1; i <= 1000000; i++){
        int now = -1;
        for(int j = 0; j < 200; j++){
            if(!used[i][j]) {
                now = j;
                break;
            }
        }
        gr[i] = now;
        int t = i * 2;
        while(t <= 1000000){
            used[t][now] = true;
            t += i;
        }
    }
    int res = 0;
    for(int i = 0; i < N; i++){
        res ^= gr[A[i]];
    }
    if(res == 0) cout << "black" << endl;
    else cout << "white" << endl;
}
0