結果
問題 | No.305 鍵(2) |
ユーザー |
![]() |
提出日時 | 2016-10-22 11:27:45 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 24 ms / 2,000 ms |
コード長 | 816 bytes |
コンパイル時間 | 1,281 ms |
コンパイル使用メモリ | 160,336 KB |
実行使用メモリ | 25,220 KB |
平均クエリ数 | 34.46 |
最終ジャッジ日時 | 2024-07-17 00:34:31 |
合計ジャッジ時間 | 2,439 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> //const static double de_PI = 3.14159265358979323846; //const static int de_MOD = 1000000007; //const static int de_MAX = 999999999; //const static int de_MIN = -999999999; int main(void) { //std::ifstream in("123.txt"); std::cin.rdbuf(in.rdbuf()); std::string ans = "0000000000", result; int before = -1, now = -1, i = 0; while (1) { std::cout << ans << std::endl; std::cin >> now >> result; if (result == "unlocked") { return 0; } if (before == -1) { if (now == 0) { for (int j = 0; j < 10; j++) { ans[j]++; } continue; } before = now; ans[i]++; continue; } if (before < now) { i++; before = now; ans[i]++; continue; } if (before > now) { ans[i]--; i++; ans[i]++; continue; } ans[i]++; } }