結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-10 20:21:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 390 bytes
コンパイル時間 2,064 ms
コンパイル使用メモリ 197,780 KB
実行使用メモリ 24,408 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-24 02:18:56
合計ジャッジ時間 4,420 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
23,928 KB
testcase_01 AC 36 ms
23,520 KB
testcase_02 AC 37 ms
24,204 KB
testcase_03 AC 37 ms
23,400 KB
testcase_04 AC 34 ms
23,376 KB
testcase_05 AC 39 ms
23,364 KB
testcase_06 AC 36 ms
23,640 KB
testcase_07 AC 35 ms
24,408 KB
testcase_08 AC 37 ms
23,628 KB
testcase_09 AC 36 ms
24,204 KB
testcase_10 AC 36 ms
23,796 KB
testcase_11 AC 36 ms
23,340 KB
testcase_12 AC 38 ms
23,628 KB
testcase_13 AC 37 ms
24,384 KB
testcase_14 AC 37 ms
24,276 KB
testcase_15 AC 36 ms
24,000 KB
testcase_16 AC 37 ms
24,000 KB
testcase_17 AC 35 ms
24,264 KB
testcase_18 AC 36 ms
23,628 KB
testcase_19 AC 37 ms
23,388 KB
testcase_20 AC 36 ms
23,628 KB
testcase_21 AC 38 ms
23,532 KB
testcase_22 AC 36 ms
23,532 KB
testcase_23 AC 35 ms
24,000 KB
testcase_24 AC 35 ms
24,264 KB
testcase_25 AC 36 ms
23,376 KB
testcase_26 AC 36 ms
23,988 KB
testcase_27 AC 35 ms
23,340 KB
testcase_28 AC 35 ms
23,628 KB
testcase_29 AC 37 ms
24,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n,k;
    cin>>n>>k;
    int a;
    if ((n-1)%(k+1)==0) {
        a=0;
        cout<<a<<endl;
    } else {
        a=(n-1)%(k+1);
        cout<<a<<endl;
    }
    while (true) {
        int b;
        cin>>b;
        if (b>=n) break;
        a=b+k+1-(b-a);
        cout<<a<<endl;
    }
    return 0;
}
0