結果

問題 No.5016 Worst Mayor
ユーザー Fu_L
提出日時 2023-04-29 14:20:22
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 1,678 bytes
コンパイル時間 4,545 ms
コンパイル使用メモリ 261,432 KB
実行使用メモリ 24,324 KB
スコア 368,609,440
平均クエリ数 400.00
最終ジャッジ日時 2023-04-29 14:20:47
合計ジャッジ時間 11,776 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using P = pair<ll, ll>;
using mint = modint998244353;
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define rrep(i, a, b) for(ll i = a; i >= b; i--)
constexpr ll inf = 4e18;
struct RandomNumberGenerator {
mt19937_64 mt;
RandomNumberGenerator()
: mt(chrono::steady_clock::now().time_since_epoch().count()) {}
ll operator()(ll l, ll r) {
uniform_int_distribution<ll> dist(l, r);
return dist(mt);
}
} rng;
int main(void) {
cin.tie(0);
ios::sync_with_stdio(0);
const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
int n, t;
cin >> n >> t;
vector<int> a(n), b(n), c(n), d(n);
rep(i, 0, n) {
cin >> a[i] >> b[i] >> c[i] >> d[i];
a[i]--;
b[i]--;
c[i]--;
d[i]--;
}
ll u;
int v;
rep(day, 0, t) {
cin >> u >> v;
int ty = 0, x = -1, y = -1, z = -1, w = -1;
if(v < 25) {
ty = 2;
} else {
if(u >= 2000000 and day < t - 10) {
ty = 1;
x = rng(0, 13);
y = rng(0, 13);
while(!(0 <= z and z < 14 and 0 <= w and w < 14)) {
int dir = rng(0, 3);
z = x + dx[dir];
w = y + dy[dir];
}
} else {
ty = 3;
}
}
if(ty == 1) {
cout << ty << ' ' << x + 1 << ' ' << y + 1 << ' ' << z + 1 << ' ' << w + 1 << endl;
} else {
cout << ty << endl;
}
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0