結果

問題 No.5017 Tool-assisted Shooting
ユーザー merom686
提出日時 2023-07-16 14:47:11
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 1,015 bytes
コンパイル時間 2,099 ms
コンパイル使用メモリ 198,868 KB
実行使用メモリ 24,408 KB
スコア 176,643
平均クエリ数 1373.83
最終ジャッジ日時 2023-07-16 14:47:24
合計ジャッジ時間 12,756 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 100
権限があれば一括ダウンロードができます

ソースコード

diff #

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

array<int, 2> b[1100][25];

int main() {
    int x = 12, y = 0, l = 100;
    for (int turn = 0; turn < 1000; turn++) {
        int n;
        cin >> n;

        if (n < 0) exit(0);

        for (int i = 0; i < n; i++) {
            int h, p, x;
            cin >> h >> p >> x;

            b[y + 60][x] = { h, p };
        }
        y++;

        char c = 'S';
        if (b[y + 1][x][0] > l / 100) {
            c = 'R';
            if (b[y + 1][(x + 1) % 25][0] > l / 100) c = 'L';
        }
        cout << c << endl;

        x += (c == 'R') - (c == 'L');
        x = (x + 25) % 25;
        for (int i = 1; i < 60; i++) {
            if (auto &h = b[y + i][x][0]; h > 0) {
                h -= l / 100;
                if (h <= 0) {
                    h = 0;
                    l += b[y + i][x][1];
                }
                cout << "#" << l << ' ' << h << '\n';
                break;
            }
        }
    }

    return 0;
}
0