結果
問題 |
No.257 N言っちゃダメゲーム (3)
|
ユーザー |
![]() |
提出日時 | 2015-07-31 22:42:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 55 ms / 2,000 ms |
コード長 | 483 bytes |
コンパイル時間 | 613 ms |
コンパイル使用メモリ | 72,636 KB |
実行使用メモリ | 25,220 KB |
平均クエリ数 | 3.70 |
最終ジャッジ日時 | 2024-07-16 20:54:34 |
合計ジャッジ時間 | 3,792 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#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); val += r; cout << val << endl; cin >> val; } return 0; }