結果

問題 No.305 鍵(2)
ユーザー 0w10w1
提出日時 2016-11-26 17:32:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 568 bytes
コンパイル時間 1,465 ms
コンパイル使用メモリ 166,776 KB
実行使用メモリ 24,276 KB
平均クエリ数 92.62
最終ジャッジ日時 2023-09-24 00:43:30
合計ジャッジ時間 2,554 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,904 KB
testcase_01 AC 22 ms
23,304 KB
testcase_02 AC 24 ms
23,616 KB
testcase_03 AC 22 ms
23,580 KB
testcase_04 AC 24 ms
23,316 KB
testcase_05 AC 23 ms
23,736 KB
testcase_06 AC 20 ms
24,276 KB
testcase_07 AC 23 ms
24,228 KB
testcase_08 AC 23 ms
23,892 KB
testcase_09 AC 25 ms
23,328 KB
testcase_10 AC 26 ms
23,904 KB
testcase_11 AC 26 ms
23,316 KB
testcase_12 AC 24 ms
23,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main(){
  int ans = 0;
  for( int i = ( int ) 1e9; i; i /= 10 ){
    vector< int > match( 10 );
    for( int j = 0; j < 10; ++j ){
      cout << setw( 10 ) << setfill( '0' ) << j * i << endl;
      int m; string r; cin >> m >> r;
      if( r == "unlocked" )
        exit( 0 );
      match[ j ] = m;
    }
    ans = ans * 10 + max_element( match.begin(), match.end() ) - match.begin();
  }
  cout << setw( 10 ) << setfill( '0' ) << ans << endl;
  int m; string r; cin >> m >> r;
  return 0;
}
0