結果

問題 No.249 N言っちゃダメゲーム (2)
ユーザー suibaka_kusuibaka_ku
提出日時 2017-03-12 02:40:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 640 bytes
コンパイル時間 645 ms
コンパイル使用メモリ 70,724 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 20:18:55
合計ジャッジ時間 1,050 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 3 ms
4,376 KB
testcase_02 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <tuple>
#include <algorithm>
using namespace std;
using ll = long long;

int main() {
    int res = 0;
    int turn = 0; // 0: you
    for(int i=0; i<1000; ++i) {
        ll N, K;
        cin >> N >> K;
        if(turn == 0) {
            if(N <= K || N % (K+1) != 0) {
                res++;
                turn = 1;
            } else {
                turn = 0;
            }
        } else {
            if(N <= K || N % (K+1) != 0) {
                turn = 0;
            } else {
                res++;
                turn = 1;
            }
        }
    }
    cout << res << endl;
}
0