結果

問題 No.305 鍵(2)
ユーザー yuruhiya
提出日時 2020-03-04 20:50:20
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 902 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 32,528 KB
最終ジャッジ日時 2025-01-09 04:24:57
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 13
権限があれば一括ダウンロードができます

ソースコード

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 (gc() == 'u')return 0;
    rep(_, 6)gc();
    
    REP(j, 1, 10) {
      ans[i] = '0' + j;
      out();
      int b = input();
      if (gc() == 'u')return 0;
      rep(_, 6)gc();
      if (a != b)break;
    }
  }
  out();
}
0