結果

問題 No.1665 quotient replace
ユーザー zezerozezero
提出日時 2021-09-03 22:02:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,928 ms / 3,000 ms
コード長 703 bytes
コンパイル時間 3,117 ms
コンパイル使用メモリ 157,728 KB
実行使用メモリ 7,052 KB
最終ジャッジ日時 2023-08-21 21:51:14
合計ジャッジ時間 19,842 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 10 ms
4,380 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 AC 6 ms
4,380 KB
testcase_09 AC 31 ms
4,384 KB
testcase_10 AC 327 ms
4,380 KB
testcase_11 AC 731 ms
5,836 KB
testcase_12 AC 81 ms
4,380 KB
testcase_13 AC 966 ms
7,052 KB
testcase_14 AC 971 ms
6,888 KB
testcase_15 AC 965 ms
6,996 KB
testcase_16 AC 968 ms
6,992 KB
testcase_17 AC 968 ms
6,960 KB
testcase_18 AC 2 ms
4,384 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 2 ms
4,384 KB
testcase_22 AC 2 ms
4,384 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 2 ms
4,384 KB
testcase_26 AC 7 ms
4,380 KB
testcase_27 AC 20 ms
4,384 KB
testcase_28 AC 85 ms
4,380 KB
testcase_29 AC 172 ms
4,380 KB
testcase_30 AC 1,258 ms
5,280 KB
testcase_31 AC 1,928 ms
5,952 KB
testcase_32 AC 699 ms
5,788 KB
testcase_33 AC 265 ms
4,384 KB
testcase_34 AC 564 ms
5,692 KB
testcase_35 AC 516 ms
5,064 KB
testcase_36 AC 541 ms
5,112 KB
testcase_37 AC 493 ms
5,332 KB
testcase_38 AC 594 ms
5,376 KB
testcase_39 AC 412 ms
4,536 KB
testcase_40 AC 414 ms
4,856 KB
testcase_41 AC 415 ms
4,904 KB
testcase_42 AC 2 ms
4,384 KB
testcase_43 AC 1 ms
4,380 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