結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
yuruhiya
|
| 提出日時 | 2020-03-04 21:02:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 2,000 ms |
| コード長 | 1,019 bytes |
| コンパイル時間 | 504 ms |
| コンパイル使用メモリ | 32,900 KB |
| 最終ジャッジ日時 | 2025-01-09 04:25:49 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
ソースコード
#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(stdout);
}
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("?!");
}
}
yuruhiya