結果
問題 | No.1149 色塗りゲーム |
ユーザー |
|
提出日時 | 2020-09-09 17:36:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 138 ms / 2,000 ms |
コード長 | 364 bytes |
コンパイル時間 | 558 ms |
コンパイル使用メモリ | 65,576 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 19.88 |
最終ジャッジ日時 | 2024-07-17 06:58:00 |
合計ジャッジ時間 | 7,247 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 50 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream>using namespace std;int N;main(){cin>>N;int R;if(N%2==1){cout<<"1 "<<N/2+1<<endl;R=N/2+1;}else{cout<<"2 "<<N/2<<endl;R=N/2+1;}while(true){int t;cin>>t;if(t==0||t==1)break;int k,x;cin>>k>>x;if(t==2)break;if(x<R){cout<<k<<" "<<x+R<<endl;}else{cout<<k<<" "<<x-R<<endl;}}}