結果
問題 | No.1149 色塗りゲーム |
ユーザー |
![]() |
提出日時 | 2020-08-07 22:01:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 173 ms / 2,000 ms |
コード長 | 804 bytes |
コンパイル時間 | 2,745 ms |
コンパイル使用メモリ | 207,476 KB |
最終ジャッジ日時 | 2025-01-12 16:53:25 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 50 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:9:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d",&N); | ~~~~~^~~~~~~~~ main.cpp:18:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 18 | scanf("%d",&t); | ~~~~~^~~~~~~~~ main.cpp:22:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 22 | scanf("%d%d",&k,&x); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#pragma GCC optimize ("Ofast")#include<bits/stdc++.h>using namespace std;int N;int main(){int t;int k;int x;scanf("%d",&N);if(N%2==0){printf("%d %d\n",2,(N+1)/2);}else{printf("%d %d\n",1,(N+1)/2);}fflush(stdout);for(;;){scanf("%d",&t);if(t==0){break;}scanf("%d%d",&k,&x);if(k==2){x++;}printf("%d %d\n",k,N+1-x);fflush(stdout);}return 0;}// cLay varsion 20200509-1// --- original code ---// int N;// {// int t, k, x;// scanf("%d",&N);//// printf("%d %d\n",if[N%2==0,2,1],(N+1)/2);// fflush(stdout);//// for(;;){// scanf("%d",&t);// if(t==0) break;// scanf("%d%d",&k,&x);// if(k==2) x++;// printf("%d %d\n",k,N+1-x);// fflush(stdout);// }// }