結果
| 問題 |
No.1149 色塗りゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-07 22:11:49 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 2,131 bytes |
| コンパイル時間 | 2,097 ms |
| コンパイル使用メモリ | 193,064 KB |
| 最終ジャッジ日時 | 2025-01-12 17:00:28 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 RE * 37 |
ソースコード
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}
void solve(){
ll N;
cin >> N;
ll state[110] = {};
state[N] = 1;
while(true){
ll K = -1,X = -1;
ll num = 0;
ll cnt = 0;
bool end = false;
// printa(state,N);
rep(i,0,N){
rep(k,1,3){
if(state[i] == 1) continue;
if(k == 2 && state[i+1] == 1) continue;
rep(j,i,i+k){
state[j] = 1;
}
ll num = 0, res = 0;
rep(j,0,N+1){
if(state[j] == 0){
num++;
}else{
if(num > 0){
res ^= num;
num = 0;
}
}
}
rep(j,i,i+k){
state[j] = 0;
}
if(res == 0){
end = true;
// print("ok",k,i);
K = k;
X = i;
break;
}
}
if(end) break;
}
rep(i,X,X+K){
state[i] = 1;
}
cout << K << " " << X+1 << endl;
ll t;
cin >> t;
if(t == 0 || t == 2){
return;
}else if(t == 1){
exit(1);
}else{
ll k,x;
cin >> k >> x;
if(k == 1){
state[x-1] = 1;
}else{
state[x-1] = 1;
state[x] = 1;
}
}
}
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
solve();
}