結果
問題 | No.257 N言っちゃダメゲーム (3) |
ユーザー |
![]() |
提出日時 | 2015-07-31 22:38:51 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 508 bytes |
コンパイル時間 | 597 ms |
コンパイル使用メモリ | 72,776 KB |
実行使用メモリ | 25,604 KB |
平均クエリ数 | 1.93 |
最終ジャッジ日時 | 2024-07-16 05:16:55 |
合計ジャッジ時間 | 4,302 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 27 |
ソースコード
#include <iostream>#include <vector>#include <cstdio>#include <sstream>#include <map>#include <string>#include <algorithm>#include <queue>#include <cmath>#include <set>using namespace std;int main(){int n,k;cin >> n >> k;bool first = ((n-1) % (k+1) != 0);int val = 0;int b;if(first == false){cout << 0 << endl;cin >> b;val += b;}while(val < n){int r = (n-1-val)%(k+1);if(r == 0) r += k;val += r;cout << r << endl;cin >> b;val += b;}return 0;}