結果
問題 | No.257 N言っちゃダメゲーム (3) |
ユーザー |
![]() |
提出日時 | 2015-08-06 12:27:53 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 55 ms / 2,000 ms |
コード長 | 297 bytes |
コンパイル時間 | 1,198 ms |
コンパイル使用メモリ | 158,336 KB |
実行使用メモリ | 25,220 KB |
平均クエリ数 | 3.70 |
最終ジャッジ日時 | 2024-07-16 21:09:55 |
合計ジャッジ時間 | 4,301 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d%d",&N,&K); | ~~~~~^~~~~~~~~~~~~~ main.cpp:11:16: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | while(scanf("%d",&res),res<N){ | ~~~~~^~~~~~~~~~~
ソースコード
#include<bits/stdc++.h>using namespace std;int main(){int N,K;scanf("%d%d",&N,&K);int a=(N-1)%(K+1);printf("%d\n",a);fflush(stdout);int res;while(scanf("%d",&res),res<N){a+=K+1;printf("%d\n",a);fflush(stdout);}return 0;}