結果
| 問題 |
No.1665 quotient replace
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-03 22:02:41 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,759 ms / 3,000 ms |
| コード長 | 703 bytes |
| コンパイル時間 | 3,028 ms |
| コンパイル使用メモリ | 158,720 KB |
| 最終ジャッジ日時 | 2025-01-24 05:48:14 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
#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;
}