結果
問題 | No.305 鍵(2) |
ユーザー | xuzijian629 |
提出日時 | 2018-10-27 20:04:31 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 624 bytes |
コンパイル時間 | 1,974 ms |
コンパイル使用メモリ | 198,220 KB |
実行使用メモリ | 24,408 KB |
平均クエリ数 | 52.15 |
最終ジャッジ日時 | 2023-09-24 02:00:04 |
合計ジャッジ時間 | 3,537 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 29 ms
24,000 KB |
testcase_01 | AC | 27 ms
23,544 KB |
testcase_02 | AC | 27 ms
23,388 KB |
testcase_03 | AC | 27 ms
23,628 KB |
testcase_04 | AC | 27 ms
24,408 KB |
testcase_05 | AC | 30 ms
24,252 KB |
testcase_06 | AC | 25 ms
24,036 KB |
testcase_07 | AC | 28 ms
23,520 KB |
testcase_08 | AC | 29 ms
24,060 KB |
testcase_09 | AC | 28 ms
23,628 KB |
testcase_10 | AC | 28 ms
23,520 KB |
testcase_11 | AC | 28 ms
24,252 KB |
testcase_12 | AC | 28 ms
23,628 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; using i64 = int64_t; using vi = vector<i64>; using vvi = vector<vi>; string num = "0000000000"; int digit = 0; int crtres = -1; void ans() { cout << num << endl; int res; cin >> res; string hoge; cin >> hoge; if (res == 10) { exit(0); } if (crtres == -1) { crtres = res; num[digit]++; } else if (crtres > res) { num[digit]--; digit++; } else if (res > crtres) { digit++; crtres = res; } else { num[digit]++; } } int main() { while (1) { ans(); } }