結果
問題 | No.257 N言っちゃダメゲーム (3) |
ユーザー |
![]() |
提出日時 | 2016-01-16 18:46:23 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 64 ms / 2,000 ms |
コード長 | 397 bytes |
コンパイル時間 | 501 ms |
コンパイル使用メモリ | 59,092 KB |
実行使用メモリ | 25,556 KB |
平均クエリ数 | 3.70 |
最終ジャッジ日時 | 2024-07-16 22:51:08 |
合計ジャッジ時間 | 4,339 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n, k, a = 0; cin >> n >> k; int b = (n - 1) % (k + 1); cout << b << endl; cout.flush(); while(cin >> a , a < n) { int s = (a - b) / (k + 1); int d = a - (b + (k + 1) * s); cout << a + k + 1 - d << endl; cout.flush(); } }