結果
| 問題 |
No.257 N言っちゃダメゲーム (3)
|
| コンテスト | |
| ユーザー |
tetsuzuki1115
|
| 提出日時 | 2018-03-07 20:44:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 725 bytes |
| コンパイル時間 | 720 ms |
| コンパイル使用メモリ | 82,532 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 1.43 |
| 最終ジャッジ日時 | 2024-07-16 15:39:26 |
| 合計ジャッジ時間 | 3,909 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 24 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;
long long MOD = 1000000007;
int main() {
long long N,K;
cin >> N >> K;
bool turn = (N-1)%(K+1) ? true : false;
if ( (N-1)%(K+1) == 0 ) { cout << 0 << endl << flush; }
long long a = 0;
while ( true ) {
if ( turn ) {
a += K+1 - a%(K+1);
cout << a << endl << flush;
}
else {
cin >> a;
if ( a >= N ) { return 0; }
}
turn = !turn;
}
return 0;
}
tetsuzuki1115