結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー kpinkcatkpinkcat
提出日時 2023-12-08 19:25:13
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 382 ms / 2,000 ms
コード長 638 bytes
コンパイル時間 944 ms
コンパイル使用メモリ 104,080 KB
実行使用メモリ 24,000 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-12-08 19:25:19
合計ジャッジ時間 6,000 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
24,000 KB
testcase_01 AC 58 ms
24,000 KB
testcase_02 AC 57 ms
24,000 KB
testcase_03 AC 57 ms
24,000 KB
testcase_04 AC 54 ms
24,000 KB
testcase_05 AC 57 ms
24,000 KB
testcase_06 AC 56 ms
24,000 KB
testcase_07 AC 382 ms
24,000 KB
testcase_08 AC 58 ms
24,000 KB
testcase_09 AC 56 ms
24,000 KB
testcase_10 AC 59 ms
24,000 KB
testcase_11 AC 54 ms
24,000 KB
testcase_12 AC 55 ms
24,000 KB
testcase_13 AC 56 ms
24,000 KB
testcase_14 AC 55 ms
24,000 KB
testcase_15 AC 55 ms
24,000 KB
testcase_16 AC 56 ms
24,000 KB
testcase_17 AC 54 ms
24,000 KB
testcase_18 AC 56 ms
24,000 KB
testcase_19 AC 56 ms
24,000 KB
testcase_20 AC 106 ms
24,000 KB
testcase_21 AC 78 ms
24,000 KB
testcase_22 AC 193 ms
24,000 KB
testcase_23 AC 89 ms
24,000 KB
testcase_24 AC 117 ms
24,000 KB
testcase_25 AC 82 ms
24,000 KB
testcase_26 AC 117 ms
24,000 KB
testcase_27 AC 68 ms
24,000 KB
testcase_28 AC 80 ms
24,000 KB
testcase_29 AC 64 ms
24,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<math.h>
#include<bitset>
using ll = long long;
using namespace std;

int main(){
    int n, k, s= 0, t;
    cin >> n >> k;
    if (n == 1){
        cout << 0 << endl;
        return 0;
    }
    t = (n-1)%(k+1);
    if (!t) {
        cout << 0 << endl;
        cin >> s;
    } else s = 0;
    while (s < n){
        for (int i = s + 1; i <= s + k; i++){
            if (i%(k+1) == t) {
                cout << i << endl;
                break;
            }
        }
        cin >> s;
    }
}
0