結果

問題 No.305 鍵(2)
ユーザー yuruhiyayuruhiya
提出日時 2020-03-04 20:57:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,018 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 36,164 KB
実行使用メモリ 36,260 KB
最終ジャッジ日時 2023-09-23 20:41:48
合計ジャッジ時間 6,842 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#pragma GCC optimize ("Ofast")
#include <cstdio>
#include <cctype>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, m, n) for (int i = (m); i < (n); ++i)

#define gc getchar_unlocked
#define pc putchar_unlocked
//#define gc _getchar_nolock
//#define pc _putchar_nolock

inline int input()noexcept {
	int v = 0; char c = gc();
	for (; isdigit(c); c = gc()) {
	  v *= 10;
		v += c - '0';
  }
	return v;
}

char ans[10];
inline void out() {
  rep(i, 10)pc(ans[i]);
  pc('\n'); fflush(stdin);
}

int main() {
  rep(i, 10)ans[i] = '0';
  
  rep(i, 10) {
    out();
    int a = input();
    if (a == 10)return 0;
    rep(_, 7)gc();
    
    REP(j, 1, 10) {
      ans[i] = '0' + j;
      out();
      int b = input();
      if (b == 10)return 0;
      rep(_, 7)gc();
      if (a > b) {
        ans[i] = '0';
        break;
      } else if (a < b) {
        break;
      }
    }
  }
  out();
  if (input() != 10) {
    puts("?!");
  }
}
0