結果
| 問題 |
No.1665 quotient replace
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-03 21:28:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 333 bytes |
| コンパイル時間 | 825 ms |
| コンパイル使用メモリ | 63,744 KB |
| 実行使用メモリ | 7,568 KB |
| 最終ジャッジ日時 | 2024-12-15 10:03:40 |
| 合計ジャッジ時間 | 8,935 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 WA * 11 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
int isp[1<<20];
main()
{
for(int i=2;i<1<<20;i++)if(!isp[i])
{
for(int j=i;j<1<<20;j+=i)isp[j]=i;
}
int N;
cin>>N;
int x=0;
for(;N--;)
{
int A;cin>>A;
while(A>1)
{
int p=isp[A];
int cnt=0;
while(A%p==0)A/=p,cnt++;
x^=cnt;
}
}
cout<<(x?"white":"black")<<endl;
}