結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー BantakoBantako
提出日時 2018-05-27 22:17:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 596 bytes
コンパイル時間 1,352 ms
コンパイル使用メモリ 164,528 KB
実行使用メモリ 24,456 KB
平均クエリ数 7.47
最終ジャッジ日時 2023-09-23 16:04:15
合計ジャッジ時間 4,824 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
23,520 KB
testcase_01 WA -
testcase_02 AC 41 ms
23,652 KB
testcase_03 WA -
testcase_04 AC 40 ms
23,676 KB
testcase_05 AC 40 ms
23,400 KB
testcase_06 AC 40 ms
24,048 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 40 ms
23,424 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 42 ms
23,364 KB
testcase_17 WA -
testcase_18 AC 40 ms
23,832 KB
testcase_19 AC 41 ms
24,276 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    6 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
main(){
    int N,K;
    cin >> N >> K;
    //N % (K+1) == 0なら先行  
    if(N % (K+1) == 0){
        int num = 0;
        while(num < N){
            cout << num / (K+1) * (K+1) + K << endl;
            fflush(0);
            cin >> num;
        }
    }else{
        cout << 0 << endl;
        fflush(0);
        int num;
        cin >> num;
        while(num < N){
            cout << (num + K) / (K+1) * (K+1) << endl;
            fflush(0);
            cin >> num;
        }
    }
}
0