結果
| 問題 |
No.8093 Please GCD
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-04-03 19:29:28 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 566 bytes |
| コンパイル時間 | 1,673 ms |
| コンパイル使用メモリ | 172,556 KB |
| 実行使用メモリ | 25,496 KB |
| 平均クエリ数 | 505.00 |
| 最終ジャッジ日時 | 2024-11-24 01:34:13 |
| 合計ジャッジ時間 | 17,653 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 19 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin>>N;
vector<int>prime(N+1,1);
vector<int>ask;
for(int i=2;i<=N;i++){
if(prime[i]==0)continue;
int t=i;
while(t*i<=N)t*=i;
ask.push_back(t);
for(int j=i*i;j<=N;j+=i){
prime[j]=0;
}
}
random_device sd;
mt19937 rd(sd());
shuffle(ask.begin(),ask.end(),rd);
int ans=1;
for(int i=0,t;i<min(600,(int)ask.size());i++){
cout<<"? "<<ask[i]<<endl;
cin>>t;
ans*=t;
}
cout<<"! "<<ans<<'\n';
}