結果
問題 | No.305 鍵(2) |
ユーザー |
![]() |
提出日時 | 2015-11-28 21:02:30 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 1,146 bytes |
コンパイル時間 | 1,422 ms |
コンパイル使用メモリ | 161,932 KB |
実行使用メモリ | 25,220 KB |
平均クエリ数 | 52.15 |
最終ジャッジ日時 | 2024-07-16 21:55:41 |
合計ジャッジ時間 | 3,114 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef complex<double> P; typedef pair<int,int> pii; #define REP(i,n) for(ll i=0;i<n;++i) #define REPR(i,n) for(ll i=1;i<n;++i) #define FOR(i,a,b) for(ll i=a;i<b;++i) #define DEBUG(x) cout<<#x<<": "<<x<<endl #define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl #define ALL(a) (a).begin(),(a).end() #define MOD (ll)(1e9+7) #define ADD(a,b) a=((a)+(b))%MOD #define FIX(a) ((a)%MOD+MOD)%MOD int main(){ string fin = ""; string cand = ""; bool ok = false; REP(i,10){ int cl = -1; REP(j,10){ string s = fin; s += (j+'0'); REP(_,10-1-i) s += "0"; cout << s << endl; int x; string t; cin >> x >> t; if(x==10){ ok = true; fin += (j+'0'); break; } if(cl == -1){ cl = x; cand = fin; cand += (j+'0'); }else if(x > cl){ cl = x; fin += (j+'0'); break; }else if(x < cl){ fin = cand; break; } } if(ok)break; } return 0; }