結果
問題 | No.257 N言っちゃダメゲーム (3) |
ユーザー | Bantako |
提出日時 | 2018-05-27 22:17:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 596 bytes |
コンパイル時間 | 1,396 ms |
コンパイル使用メモリ | 167,296 KB |
実行使用メモリ | 25,788 KB |
平均クエリ数 | 7.47 |
最終ジャッジ日時 | 2024-07-16 15:50:20 |
合計ジャッジ時間 | 4,558 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 WA * 21 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~
ソースコード
#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; } } }