結果
問題 | No.1149 色塗りゲーム |
ユーザー |
![]() |
提出日時 | 2020-08-07 21:37:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 132 ms / 2,000 ms |
コード長 | 564 bytes |
コンパイル時間 | 2,154 ms |
コンパイル使用メモリ | 192,440 KB |
最終ジャッジ日時 | 2025-01-12 16:04:52 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 50 |
ソースコード
#define rep(i, n) for (int i = 0; i < (int)(n); i++)#define ALL(v) v.begin(), v.end()typedef long long ll;#include <bits/stdc++.h>using namespace std;int main(){int n;cin>>n;if(n==1) cout<<1<<" "<<1<<endl;else if(n==2) cout<<2<<" "<<1<<endl;else if(n%2==1) cout<<1<<" "<<(n+1)/2<<endl;else cout<<2<<" "<<n/2<<endl;int t,k,x;while(cin>>t){if(t==0 || t==1) return 0;cin>>k>>x;if(t==2) return 0;if(k==1){cout<<1<<" "<<n-x+1<<endl;}else{cout<<2<<" "<<n-x<<endl;}}return 0;}