結果

問題 No.5016 Worst Mayor
ユーザー tanutanu
提出日時 2023-04-29 16:56:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 1,630 bytes
コンパイル時間 2,327 ms
コンパイル使用メモリ 174,500 KB
実行使用メモリ 24,384 KB
スコア 788,569,550
平均クエリ数 400.00
最終ジャッジ日時 2023-04-29 16:59:36
合計ジャッジ時間 9,719 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
23,412 KB
testcase_01 AC 84 ms
23,988 KB
testcase_02 AC 89 ms
24,156 KB
testcase_03 AC 82 ms
23,424 KB
testcase_04 AC 81 ms
23,448 KB
testcase_05 AC 82 ms
23,976 KB
testcase_06 AC 81 ms
23,436 KB
testcase_07 AC 82 ms
23,880 KB
testcase_08 AC 82 ms
23,676 KB
testcase_09 AC 81 ms
24,252 KB
testcase_10 AC 82 ms
23,676 KB
testcase_11 AC 83 ms
23,412 KB
testcase_12 AC 81 ms
23,616 KB
testcase_13 AC 83 ms
23,568 KB
testcase_14 AC 82 ms
23,532 KB
testcase_15 AC 82 ms
23,544 KB
testcase_16 AC 81 ms
24,096 KB
testcase_17 AC 83 ms
23,460 KB
testcase_18 AC 84 ms
23,664 KB
testcase_19 AC 81 ms
23,988 KB
testcase_20 AC 82 ms
24,180 KB
testcase_21 AC 84 ms
23,424 KB
testcase_22 AC 83 ms
23,532 KB
testcase_23 AC 82 ms
23,688 KB
testcase_24 AC 82 ms
23,592 KB
testcase_25 AC 82 ms
24,228 KB
testcase_26 AC 84 ms
23,376 KB
testcase_27 AC 83 ms
24,312 KB
testcase_28 AC 84 ms
23,988 KB
testcase_29 AC 82 ms
24,252 KB
testcase_30 AC 79 ms
23,640 KB
testcase_31 AC 107 ms
23,640 KB
testcase_32 AC 81 ms
24,252 KB
testcase_33 AC 78 ms
23,400 KB
testcase_34 AC 83 ms
23,652 KB
testcase_35 AC 83 ms
23,412 KB
testcase_36 AC 81 ms
23,424 KB
testcase_37 AC 83 ms
23,976 KB
testcase_38 AC 81 ms
24,384 KB
testcase_39 AC 82 ms
23,532 KB
testcase_40 AC 82 ms
23,820 KB
testcase_41 AC 84 ms
23,640 KB
testcase_42 AC 81 ms
23,652 KB
testcase_43 AC 83 ms
23,820 KB
testcase_44 AC 82 ms
23,616 KB
testcase_45 AC 83 ms
24,168 KB
testcase_46 AC 82 ms
23,376 KB
testcase_47 AC 82 ms
24,252 KB
testcase_48 AC 81 ms
23,820 KB
testcase_49 AC 81 ms
24,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main()
{
	ll n, t, x1, y1, x2, y2, u, v, cnt = 0, x, y;
	ll map[27][27] = {0};
	vector<pair<ll, ll>> num;
	cin >> n >> t;
	vector<pair<ll, ll>> a, b;
	for (ll i = 0; i < n; i++)
	{
		cin >> x1 >> y1;
		a.push_back({x1, y1});
		cin >> x2 >> y2;
		b.push_back({x2, y2});
		if (x1 > x2)
		{
			swap(x1, x2);
		}
		if (y1 > y2)
		{
			swap(y1, y2);
		}
		for (ll p = 2 * x1 - 1; p < 2 * x2 - 2; p += 2)
		{
			for (ll q = 2 * y1 - 1; q < 2 * y2 - 2; q += 2)
			{
				map[p][q]++;
			}
		}
	}
	for (ll i = 1; i < 27; i += 2)
	{
		for (ll j = 1; j < 27; j += 2)
		{
			num.push_back({map[i][j], i + j});
		}
	}
	sort(num.begin(), num.end());
	ll i = 0;
	/*if (num[cnt].first * 30 * 25 >= 2500000)
	{
		x = num[cnt].second % 27;
		y = num[cnt].second / 27;
		if (x % 2 == 1)
		{
			cout << 1 << " " << x / 2 + 1 << " " << y / 2 + 1 << " " << x / 2 + 2 << " " << y / 2 + 1 << endl;
		}
		else
		{
			cout << 1 << " " << x / 2 + 1 << " " << y / 2 + 1 << " " << x / 2 + 1 << " " << y / 2 + 2 << endl;
		}
		cnt++;
		i++;
	}*/
	for (; i < t; i++)
	{
		cin >> u >> v;
		if (cnt == 0)
		{
			if (u >= (long long)(10000000 / sqrt(v)) + 50000)
			{
				x = num[cnt].second % 27;
				y = num[cnt].second / 27;
				if (x % 2 == 1)
				{
					cout << 1 << " " << x / 2 + 1 << " " << y / 2 + 1 << " " << x / 2 + 2 << " " << y / 2 + 1 << endl;
				}
				else
				{
					cout << 1 << " " << x / 2 + 1 << " " << y / 2 + 1 << " " << x / 2 + 1 << " " << y / 2 + 2 << endl;
				}
				cnt++;
			}
			else
			{
				cout << 2 << endl;
			}
		}
		else
		{
			cout << 3 << endl;
		}
	}
}
0