結果
| 問題 |
No.5016 Worst Mayor
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-04-29 16:51:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 88 ms / 2,000 ms |
| コード長 | 2,001 bytes |
| コンパイル時間 | 2,130 ms |
| コンパイル使用メモリ | 173,768 KB |
| 実行使用メモリ | 24,372 KB |
| スコア | 877,162,500 |
| 平均クエリ数 | 400.00 |
| 最終ジャッジ日時 | 2023-04-29 16:53:34 |
| 合計ジャッジ時間 | 9,656 ms |
|
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
| 純コード判定しない問題か言語 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long n, t, x1, y1, x2, y2, u, v, cnt = 0, x, y;
bool ok = false;
long long map[27][27] = {0};
vector<pair<long long, long long>> num;
cin >> n >> t;
vector<pair<long long, long long>> a, b;
for (long long 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 (long long p = 2 * x1 - 1; p < 2 * x2 - 2; p += 2)
{
for (long long q = 2 * y1 - 1; q < 2 * y2 - 2; q += 2)
{
map[p][q]++;
}
}
}
for (long long i = 1; i < 27; i += 2)
{
for (long long j = 1; j < 27; j += 2)
{
num.push_back({map[i][j], i + j});
}
}
sort(num.begin(), num.end());
for (long long i = 0; i < t; i++)
{
cin >> u >> v;
if (cnt <= 5 && i < 300)
{
if (u >= (long long)(10000000 / sqrt(v)) + 50000)
{
ok = true;
}
if (ok)
{
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 if (i < 99)
{
cout << 2 << endl;
}
else
{
cout << 3 << endl;
}
}
else
{
cout << 3 << endl;
}
ok = false;
}
}