結果
問題 |
No.1665 quotient replace
|
ユーザー |
![]() |
提出日時 | 2021-09-04 01:21:29 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 746 bytes |
コンパイル時間 | 782 ms |
コンパイル使用メモリ | 116,736 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-15 22:10:37 |
合計ジャッジ時間 | 6,503 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 2 RE * 17 |
ソースコード
#include <iostream> using namespace std; int A[100009]; int x = 0; int N; int factorize(int x){ int cnt = 0; int temp = x; for (int i = 2; i * i <= x; i++){ if (temp % i == 0){ while ((temp % i) == 0) { temp /= i; cnt++; } } } if (temp != 1){ cnt++; } if (cnt == 0){ cnt++; } return cnt; } int main(){ cin >> N; for (int i = 0; i < N; i++){ cin >> A[i]; } for (int i = 0; i < N; i++){ int cnt; int temp; cnt = factorize(A[i]); x ^= cnt; } if (x == 0){ cout << "black" << endl; } else{ cout << "white" << endl; } return 0; }