結果

問題 No.1665 quotient replace
ユーザー zezerozezero
提出日時 2021-09-03 22:02:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,951 ms / 3,000 ms
コード長 703 bytes
コンパイル時間 3,627 ms
コンパイル使用メモリ 166,284 KB
実行使用メモリ 7,208 KB
最終ジャッジ日時 2024-05-09 04:00:36
合計ジャッジ時間 20,543 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,820 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 3 ms
6,944 KB
testcase_04 AC 3 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 10 ms
6,940 KB
testcase_07 AC 3 ms
6,940 KB
testcase_08 AC 6 ms
6,944 KB
testcase_09 AC 32 ms
6,940 KB
testcase_10 AC 336 ms
6,944 KB
testcase_11 AC 756 ms
6,944 KB
testcase_12 AC 84 ms
6,940 KB
testcase_13 AC 995 ms
7,200 KB
testcase_14 AC 995 ms
7,208 KB
testcase_15 AC 996 ms
7,160 KB
testcase_16 AC 995 ms
7,180 KB
testcase_17 AC 1,002 ms
7,088 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 2 ms
6,944 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 2 ms
6,940 KB
testcase_26 AC 7 ms
6,944 KB
testcase_27 AC 20 ms
6,940 KB
testcase_28 AC 85 ms
6,940 KB
testcase_29 AC 175 ms
6,940 KB
testcase_30 AC 1,271 ms
6,940 KB
testcase_31 AC 1,951 ms
6,940 KB
testcase_32 AC 725 ms
6,944 KB
testcase_33 AC 272 ms
6,940 KB
testcase_34 AC 580 ms
6,940 KB
testcase_35 AC 529 ms
6,940 KB
testcase_36 AC 555 ms
6,940 KB
testcase_37 AC 510 ms
6,940 KB
testcase_38 AC 613 ms
6,944 KB
testcase_39 AC 425 ms
6,940 KB
testcase_40 AC 424 ms
6,940 KB
testcase_41 AC 426 ms
6,940 KB
testcase_42 AC 2 ms
6,940 KB
testcase_43 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstring>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)

int main(){
  int n;
  cin >> n;
  vector<int> cnt(n);
  rep(i,n){
    int x;
    cin >> x;
    for (int j = 2; j*j <= x;j++){
      while(x%j == 0){
        x/=j;
        cnt[i]++;
      }
    }
    if (x != 1) cnt[i]++;
  }
  int ans = 0;
  for (int i = 0; i < n;i++){
    ans ^= cnt[i];
  }
  if (ans != 0) cout << "white" << endl;
  else cout << "black" << endl;
  return 0;
}
0