結果

問題 No.1149 色塗りゲーム
ユーザー cookiedothcookiedoth
提出日時 2020-08-14 00:40:33
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 1,985 bytes
コンパイル時間 1,158 ms
コンパイル使用メモリ 128,468 KB
実行使用メモリ 24,408 KB
平均クエリ数 19.82
最終ジャッジ日時 2023-09-24 05:33:08
合計ジャッジ時間 7,131 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
23,592 KB
testcase_01 AC 41 ms
24,408 KB
testcase_02 AC 42 ms
23,820 KB
testcase_03 AC 43 ms
24,228 KB
testcase_04 AC 41 ms
23,376 KB
testcase_05 AC 41 ms
24,000 KB
testcase_06 AC 41 ms
24,408 KB
testcase_07 AC 41 ms
24,024 KB
testcase_08 AC 42 ms
23,592 KB
testcase_09 AC 42 ms
23,328 KB
testcase_10 AC 42 ms
23,328 KB
testcase_11 AC 43 ms
24,024 KB
testcase_12 AC 44 ms
24,240 KB
testcase_13 AC 42 ms
24,228 KB
testcase_14 AC 44 ms
23,388 KB
testcase_15 AC 43 ms
23,580 KB
testcase_16 AC 43 ms
23,952 KB
testcase_17 AC 44 ms
24,024 KB
testcase_18 AC 43 ms
23,364 KB
testcase_19 AC 44 ms
23,352 KB
testcase_20 AC 44 ms
23,520 KB
testcase_21 AC 44 ms
23,340 KB
testcase_22 AC 45 ms
23,484 KB
testcase_23 AC 45 ms
23,592 KB
testcase_24 AC 47 ms
23,508 KB
testcase_25 AC 46 ms
23,496 KB
testcase_26 AC 45 ms
23,772 KB
testcase_27 AC 46 ms
23,976 KB
testcase_28 AC 47 ms
24,216 KB
testcase_29 AC 47 ms
23,532 KB
testcase_30 AC 86 ms
23,364 KB
testcase_31 AC 80 ms
24,228 KB
testcase_32 AC 81 ms
23,532 KB
testcase_33 AC 85 ms
23,604 KB
testcase_34 AC 89 ms
23,352 KB
testcase_35 AC 84 ms
24,216 KB
testcase_36 AC 91 ms
23,520 KB
testcase_37 AC 93 ms
23,976 KB
testcase_38 AC 88 ms
23,640 KB
testcase_39 AC 94 ms
24,228 KB
testcase_40 AC 99 ms
23,376 KB
testcase_41 AC 96 ms
23,628 KB
testcase_42 AC 96 ms
23,508 KB
testcase_43 AC 95 ms
23,976 KB
testcase_44 AC 104 ms
23,580 KB
testcase_45 AC 102 ms
24,228 KB
testcase_46 AC 104 ms
23,964 KB
testcase_47 AC 110 ms
23,340 KB
testcase_48 AC 110 ms
23,664 KB
testcase_49 AC 115 ms
23,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*

Code for problem A by cookiedoth
Generated 13 Aug 2020 at 06.32 PM


______▄███████▄_______
______█▄█████▄█_______
______█▼▼▼▼▼█_______
_____██________ ██______
______█▲▲▲▲▲█_______
______█████████_______
_______██____ ██________

=_=
¯\_(ツ)_/¯
o_O

*/

#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <complex>
#include <cassert>
#include <random>
#include <cstring>
#include <numeric>
#define ll long long
#define ld long double
#define null NULL
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define debug(a) cerr << #a << " = " << a << endl
#define forn(i, n) for (int i = 0; i < n; ++i)
#define sz(a) (int)a.size()

using namespace std;

template<class T> int chkmax(T &a, T b) {
	if (b > a) {
		a = b;
		return 1;
	}
	return 0;
}

template<class T> int chkmin(T &a, T b) {
	if (b < a) {
		a = b;
		return 1;
	}
	return 0;
}

template<class iterator> void output(iterator begin, iterator end, ostream& out = cerr) {
	while (begin != end) {
		out << (*begin) << " ";
		begin++;
	}
	out << endl;
}

template<class T> void output(T x, ostream& out = cerr) {
	output(x.begin(), x.end(), out);
}

void fast_io() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

void make_move(int pos, int len) {
	cout << len << " " << pos + 1 << endl;
	int t;
	cin >> t;
	if (t == 0 || t == 1) {
		exit(0);
	}
}

void read_move(int &pos, int &k) {
	cin >> k >> pos;
	pos--;
}

int n;

signed main() {
	fast_io();
	cin >> n;
	make_move((n - 1) / 2, 1 + (n % 2 == 0));
	while (true) {
		int pos, k;
		read_move(pos, k);
		pos = n - 1 - pos - (k - 1);
		make_move(pos, k);
	}
}
0