結果
問題 | No.257 N言っちゃダメゲーム (3) |
ユーザー |
![]() |
提出日時 | 2015-07-31 23:47:15 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 599 bytes |
コンパイル時間 | 792 ms |
コンパイル使用メモリ | 59,236 KB |
実行使用メモリ | 43,684 KB |
平均クエリ数 | 0.67 |
最終ジャッジ日時 | 2024-07-16 20:59:35 |
合計ジャッジ時間 | 4,547 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 TLE * 1 -- * 24 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { int N, K; cin >> N >> K; if (N == 1) { int op; cin >> op; return 0; } int turn = 0; bool ato = (N % (K + 1) == 1); if (ato) { cout << "0" << endl; cout.flush(); } else { int winNum = (K + 1) * turn + ((N - 1) % (K + 1)); cout << winNum << endl; } while (true) { int op; cin >> op; ++turn; if (op >= N) { return 0; } int winNum = (K + 1) * turn + ((N - 1) % (K + 1)); cout << winNum << endl; cout.flush(); } getchar(); getchar(); }