結果
| 問題 |
No.1149 色塗りゲーム
|
| コンテスト | |
| ユーザー |
snow39
|
| 提出日時 | 2020-10-16 17:47:10 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 136 ms / 2,000 ms |
| コード長 | 832 bytes |
| コンパイル時間 | 809 ms |
| コンパイル使用メモリ | 93,244 KB |
| 実行使用メモリ | 25,220 KB |
| 平均クエリ数 | 19.88 |
| 最終ジャッジ日時 | 2024-07-17 07:10:13 |
| 合計ジャッジ時間 | 7,514 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
ソースコード
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}
void output(int k,int x){
cout<<k<<" "<<x<<endl;
}
int main(){
int N;
cin>>N;
if(N%2) output(1,(N+1)/2);
else output(2,N/2);
while(1){
int t;cin>>t;
if(t<=1) exit(0);
int k,x;
cin>>k>>x;
if(t==2) exit(0);
int half=N/2;
if(x<(N+1)/2) output(k,x+half+1);
else output(k,x-(half+1));
}
return 0;
}
snow39