結果

問題 No.5016 Worst Mayor
ユーザー Fu_LFu_L
提出日時 2023-04-29 14:20:22
言語 C++17
(gcc 12.3.0 + boost 1.83.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
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
23,832 KB
testcase_01 AC 82 ms
24,168 KB
testcase_02 AC 82 ms
23,880 KB
testcase_03 AC 81 ms
24,024 KB
testcase_04 AC 81 ms
23,640 KB
testcase_05 AC 82 ms
23,220 KB
testcase_06 AC 85 ms
23,364 KB
testcase_07 AC 80 ms
23,376 KB
testcase_08 AC 81 ms
23,868 KB
testcase_09 AC 80 ms
23,232 KB
testcase_10 AC 79 ms
23,640 KB
testcase_11 AC 83 ms
23,628 KB
testcase_12 AC 87 ms
23,388 KB
testcase_13 AC 80 ms
23,544 KB
testcase_14 AC 82 ms
24,324 KB
testcase_15 AC 81 ms
23,208 KB
testcase_16 AC 84 ms
23,232 KB
testcase_17 AC 78 ms
23,424 KB
testcase_18 AC 81 ms
23,472 KB
testcase_19 AC 82 ms
24,192 KB
testcase_20 AC 81 ms
24,024 KB
testcase_21 AC 81 ms
23,244 KB
testcase_22 AC 79 ms
23,496 KB
testcase_23 AC 81 ms
23,376 KB
testcase_24 AC 82 ms
24,204 KB
testcase_25 AC 82 ms
24,036 KB
testcase_26 AC 82 ms
24,192 KB
testcase_27 AC 81 ms
23,808 KB
testcase_28 AC 80 ms
23,532 KB
testcase_29 AC 84 ms
23,232 KB
testcase_30 AC 83 ms
24,156 KB
testcase_31 AC 82 ms
23,544 KB
testcase_32 AC 82 ms
23,640 KB
testcase_33 AC 82 ms
23,532 KB
testcase_34 AC 83 ms
23,364 KB
testcase_35 AC 86 ms
23,460 KB
testcase_36 AC 82 ms
23,868 KB
testcase_37 AC 83 ms
23,472 KB
testcase_38 AC 81 ms
23,868 KB
testcase_39 AC 81 ms
24,192 KB
testcase_40 AC 80 ms
23,820 KB
testcase_41 AC 76 ms
24,300 KB
testcase_42 AC 81 ms
23,496 KB
testcase_43 AC 82 ms
23,652 KB
testcase_44 AC 82 ms
23,424 KB
testcase_45 AC 83 ms
24,096 KB
testcase_46 AC 83 ms
23,220 KB
testcase_47 AC 83 ms
23,652 KB
testcase_48 AC 83 ms
23,844 KB
testcase_49 AC 80 ms
23,988 KB
権限があれば一括ダウンロードができます

ソースコード

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;
        }
    }
}
0