結果
問題 | No.1149 色塗りゲーム |
ユーザー | opt |
提出日時 | 2020-08-07 21:40:40 |
言語 | C++17 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 114 ms / 2,000 ms |
コード長 | 2,754 bytes |
コンパイル時間 | 1,989 ms |
コンパイル使用メモリ | 199,176 KB |
実行使用メモリ | 24,420 KB |
平均クエリ数 | 19.88 |
最終ジャッジ日時 | 2023-09-24 04:13:49 |
合計ジャッジ時間 | 8,039 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 48 ms
23,712 KB |
testcase_01 | AC | 42 ms
23,532 KB |
testcase_02 | AC | 42 ms
23,640 KB |
testcase_03 | AC | 42 ms
24,372 KB |
testcase_04 | AC | 41 ms
23,616 KB |
testcase_05 | AC | 43 ms
23,520 KB |
testcase_06 | AC | 44 ms
24,420 KB |
testcase_07 | AC | 43 ms
23,628 KB |
testcase_08 | AC | 43 ms
23,664 KB |
testcase_09 | AC | 42 ms
23,676 KB |
testcase_10 | AC | 43 ms
23,664 KB |
testcase_11 | AC | 43 ms
23,532 KB |
testcase_12 | AC | 43 ms
24,024 KB |
testcase_13 | AC | 44 ms
24,036 KB |
testcase_14 | AC | 45 ms
24,264 KB |
testcase_15 | AC | 44 ms
23,424 KB |
testcase_16 | AC | 44 ms
23,868 KB |
testcase_17 | AC | 46 ms
24,384 KB |
testcase_18 | AC | 45 ms
24,408 KB |
testcase_19 | AC | 47 ms
24,036 KB |
testcase_20 | AC | 45 ms
23,376 KB |
testcase_21 | AC | 47 ms
24,348 KB |
testcase_22 | AC | 47 ms
24,396 KB |
testcase_23 | AC | 47 ms
23,376 KB |
testcase_24 | AC | 46 ms
23,640 KB |
testcase_25 | AC | 48 ms
23,640 KB |
testcase_26 | AC | 47 ms
23,664 KB |
testcase_27 | AC | 48 ms
23,412 KB |
testcase_28 | AC | 48 ms
24,000 KB |
testcase_29 | AC | 49 ms
23,544 KB |
testcase_30 | AC | 85 ms
24,048 KB |
testcase_31 | AC | 80 ms
24,036 KB |
testcase_32 | AC | 85 ms
23,652 KB |
testcase_33 | AC | 82 ms
23,592 KB |
testcase_34 | AC | 90 ms
23,604 KB |
testcase_35 | AC | 85 ms
24,048 KB |
testcase_36 | AC | 91 ms
23,424 KB |
testcase_37 | AC | 94 ms
23,652 KB |
testcase_38 | AC | 94 ms
23,448 KB |
testcase_39 | AC | 93 ms
23,460 KB |
testcase_40 | AC | 97 ms
23,424 KB |
testcase_41 | AC | 96 ms
23,628 KB |
testcase_42 | AC | 102 ms
23,820 KB |
testcase_43 | AC | 97 ms
23,892 KB |
testcase_44 | AC | 108 ms
24,108 KB |
testcase_45 | AC | 102 ms
24,396 KB |
testcase_46 | AC | 105 ms
23,400 KB |
testcase_47 | AC | 106 ms
23,460 KB |
testcase_48 | AC | 106 ms
23,472 KB |
testcase_49 | AC | 114 ms
23,616 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using V = vector<int>; using Vll = vector<ll>; using Vld = vector<ld>; using Vbo = vector<bool>; using VV = vector<V>; using VVll = vector<Vll>; using VVld = vector<Vld>; using VVbo = vector<Vbo>; using VVV = vector<VV>; using VVVll = vector<VVll>; using P = pair<int, int>; using Pll = pair<ll, ll>; using Pld = pair<ld, ld>; #define rep2(i, m, n) for (int i = (m); i < (n); ++i) #define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i) #define rep(i, n) rep2(i, 0, n) #define drep(i, n) drep2(i, n, 0) #define all(a) (a).begin(), (a).end() // struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; template<typename T> inline int sz(T &x) { return x.size(); } template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; } template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << '(' << p.first << ", " << p.second << ')'; return os; } template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; } template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; } template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r) inline int fLog2(const int x) { assert(x > 0); return 31-__builtin_clz(x); } // floor(log2(x)) inline int fLog2(const ll x) { assert(x > 0); return 63-__builtin_clzll(x); } inline int cLog2(const int x) { assert(x > 0); return (x == 1) ? 0 : 32-__builtin_clz(x-1); } // ceil(log2(x)) inline int cLog2(const ll x) { assert(x > 0); return (x == 1) ? 0 : 64-__builtin_clzll(x-1); } inline int popcount(const int x) { return __builtin_popcount(x); } inline int popcount(const ll x) { return __builtin_popcountll(x); } void fail() { puts("-1"); exit(0); } // const int INF = 1<<30; // const ll INFll = 1ll<<62; // const ld EPS = 1e-10; // const ld PI = acos(-1.0); // const int MOD = int(1e9)+7; // const int MOD = 998244353; int main() { int n; cin >> n; if (n % 2 == 1) cout << 1 << ' ' << (n+1)/2 << endl; else cout << 2 << ' ' << n/2 << endl; while (true) { int t; cin >> t; if (t == 0) return 0; int k, x; cin >> k >> x; int y; if (x <= n/2) y = x + n/2 + 1; else y = x - n/2 - 1; cout << k << ' ' << y << endl; } }