結果

問題 No.1665 quotient replace
ユーザー nawawannawawan
提出日時 2021-09-03 21:45:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2,143 ms / 3,000 ms
コード長 750 bytes
コンパイル時間 2,302 ms
コンパイル使用メモリ 209,436 KB
実行使用メモリ 100,992 KB
最終ジャッジ日時 2024-05-09 03:02:33
合計ジャッジ時間 90,545 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,814 ms
93,056 KB
testcase_01 AC 1,808 ms
93,160 KB
testcase_02 AC 1,811 ms
93,056 KB
testcase_03 AC 1,817 ms
93,056 KB
testcase_04 AC 1,908 ms
92,968 KB
testcase_05 AC 1,815 ms
93,056 KB
testcase_06 AC 1,841 ms
93,156 KB
testcase_07 AC 1,832 ms
93,056 KB
testcase_08 AC 1,836 ms
93,056 KB
testcase_09 AC 1,868 ms
93,308 KB
testcase_10 AC 1,932 ms
95,664 KB
testcase_11 AC 2,068 ms
98,944 KB
testcase_12 AC 1,864 ms
93,696 KB
testcase_13 AC 2,138 ms
100,832 KB
testcase_14 AC 2,126 ms
100,992 KB
testcase_15 AC 2,139 ms
100,828 KB
testcase_16 AC 2,143 ms
100,908 KB
testcase_17 AC 2,131 ms
100,820 KB
testcase_18 AC 1,808 ms
93,068 KB
testcase_19 AC 1,821 ms
93,112 KB
testcase_20 AC 1,828 ms
93,016 KB
testcase_21 AC 1,801 ms
93,056 KB
testcase_22 AC 1,816 ms
93,056 KB
testcase_23 AC 1,813 ms
93,232 KB
testcase_24 AC 1,818 ms
93,112 KB
testcase_25 AC 1,826 ms
93,056 KB
testcase_26 AC 1,834 ms
93,128 KB
testcase_27 AC 1,842 ms
93,056 KB
testcase_28 AC 1,852 ms
93,268 KB
testcase_29 AC 1,853 ms
93,724 KB
testcase_30 AC 1,982 ms
96,984 KB
testcase_31 AC 2,070 ms
99,080 KB
testcase_32 AC 2,042 ms
98,752 KB
testcase_33 AC 1,913 ms
95,188 KB
testcase_34 AC 1,997 ms
97,556 KB
testcase_35 AC 1,985 ms
97,164 KB
testcase_36 AC 1,990 ms
97,396 KB
testcase_37 AC 1,994 ms
96,992 KB
testcase_38 AC 2,022 ms
97,820 KB
testcase_39 AC 1,950 ms
96,360 KB
testcase_40 AC 1,960 ms
96,360 KB
testcase_41 AC 1,963 ms
96,384 KB
testcase_42 AC 1,816 ms
93,056 KB
testcase_43 AC 1,815 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