結果
| 問題 | No.1665 quotient replace | 
| コンテスト | |
| ユーザー |  沙耶花 | 
| 提出日時 | 2021-09-03 21:28:28 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 391 ms / 3,000 ms | 
| コード長 | 591 bytes | 
| コンパイル時間 | 3,887 ms | 
| コンパイル使用メモリ | 251,504 KB | 
| 最終ジャッジ日時 | 2025-01-24 04:48:29 | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 41 | 
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001
int main(){
	
	vector<int> cnt(1000001,0);
	
	for(int i=2;i<cnt.size();i++){
		if(cnt[i]!=0)continue;
		for(int j=i;j<cnt.size();j+=i){
			int t = j;
			while(t%i==0){
				t /= i;
				cnt[j] ++;
			}
		}
	}
	
	int n;
	cin>>n;
	
	int x = 0;
	rep(i,n){
		int a;
		cin>>a;
		x ^= cnt[a];
	}
	//cout<<x<<endl;
	if(x==0)cout<<"black"<<endl;
	else cout<<"white"<<endl;
	
	return 0;
}
            
            
            
        