結果
問題 | No.305 鍵(2) |
ユーザー |
![]() |
提出日時 | 2018-10-27 20:04:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 38 ms / 2,000 ms |
コード長 | 624 bytes |
コンパイル時間 | 1,683 ms |
コンパイル使用メモリ | 192,736 KB |
最終ジャッジ日時 | 2025-01-06 14:54:11 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
#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(); } }