結果
問題 | No.305 鍵(2) |
ユーザー |
![]() |
提出日時 | 2015-11-27 23:34:50 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,235 bytes |
コンパイル時間 | 722 ms |
コンパイル使用メモリ | 83,744 KB |
実行使用メモリ | 40,268 KB |
最終ジャッジ日時 | 2024-07-16 21:51:14 |
合計ジャッジ時間 | 7,203 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 12 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <cstdlib> #include <ctime> #include <cstdio> #include <functional> #include <set> #include <sstream> #include <map> #include <queue> #include <stack> using namespace std; int main(){ srand(time(NULL)); bool f[10]={}; char d[10]={}; while(true){ string out; for(int i=0;i<10;i++){ if(f[i]) out=d[i]+out; else out=(char)('0'+rand()%10)+out; } cout<<out<<endl; cout.flush(); int x; string res; cin>>x>>res; if(res[0]=='u') return 0; string test=out; for(int i=0;i<10;i++){ if(f[i]) continue; string test=out; test[i]='0'+rand()%10; cout<<test<<endl; cout.flush(); int y; string test_res; cin>>y>>test_res; if(test_res[0]=='u') return 0; if(x>y){ f[i]=true; d[i]=out[i]; }else if(x<y){ f[i]=true; d[i]=test[i]; } } } return 0; }