結果

問題 No.1149 色塗りゲーム
ユーザー AkabaEriAkabaEri
提出日時 2020-11-30 07:50:14
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 784 bytes
コンパイル時間 1,679 ms
コンパイル使用メモリ 168,260 KB
実行使用メモリ 25,476 KB
平均クエリ数 19.88
最終ジャッジ日時 2024-07-17 07:36:14
合計ジャッジ時間 8,598 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for(int i= 0; i < (n); i++)
using ll= long long int;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll mod= 1e9 + 7;
ll mmod= 998244353;



int main(){
  int n;
  cin >>n;
  if(n%2==1){cout << 1 << " " << (n+1)/2 << endl;}
  else{cout << 2 << " " << n/2 <<endl;}

  while(1){
    int t;
    cin >>t;
    if(t==0 || t==1)return 0;
    if(t==2 || t==3){
      int k,x;
      cin >> k >>x;
      if(t==2)return 0;
      int d;
      if(x<(n+2)/2){d=x+(n+2)/2;}else{d=x-(n+2)/2;}
      if(n%2==1){cout << k << " " << d << endl;}
      else{cout << k << " " << d << endl;}
    }

  }
}
0