結果

問題 No.1665 quotient replace
コンテスト
ユーザー umezo
提出日時 2021-09-03 22:17:15
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
(最新)
TLE  
(最初)
実行時間 1,527 ms / 3,000 ms
コード長 563 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,383 ms
コンパイル使用メモリ 211,636 KB
実行使用メモリ 7,552 KB
最終ジャッジ日時 2026-06-23 00:00:30
合計ジャッジ時間 13,336 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;

int prime_factor(ll x){
  int res=0;
  for(ll i=2;i*i<=x;i++){
    while(x%i==0){
      res++;
      x/=i;
    }
  }
  if(x!=1) res++;
  return res;
}
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n;
  cin>>n;
  vector<int> A(n);
  rep(i,n) cin>>A[i];
  
  int ans=0;
  rep(i,n) ans^=prime_factor(A[i]);
  if(ans==0) cout<<"black"<<endl;
  else cout<<"white"<<endl;
  
  return 0;
}
0