結果

問題 No.511 落ちゲー 〜手作業のぬくもり〜
ユーザー nukachanukacha
提出日時 2017-04-30 03:50:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 962 bytes
コンパイル時間 916 ms
コンパイル使用メモリ 72,892 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-10-11 20:29:23
合計ジャッジ時間 7,216 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 2 ms
4,372 KB
testcase_04 AC 2 ms
4,368 KB
testcase_05 AC 2 ms
4,368 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,368 KB
testcase_08 AC 1 ms
4,368 KB
testcase_09 AC 2 ms
4,372 KB
testcase_10 WA -
testcase_11 AC 2 ms
4,368 KB
testcase_12 AC 1 ms
4,368 KB
testcase_13 WA -
testcase_14 AC 1 ms
4,368 KB
testcase_15 AC 2 ms
4,368 KB
testcase_16 AC 1 ms
4,372 KB
testcase_17 WA -
testcase_18 AC 1 ms
4,372 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,368 KB
testcase_21 AC 2 ms
4,372 KB
testcase_22 AC 2 ms
4,368 KB
testcase_23 AC 3 ms
4,368 KB
testcase_24 AC 2 ms
4,372 KB
testcase_25 AC 3 ms
4,372 KB
testcase_26 AC 3 ms
4,368 KB
testcase_27 AC 3 ms
4,372 KB
testcase_28 AC 3 ms
4,372 KB
testcase_29 TLE -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

int main() {
    int n, w;
    long long h;
    int p[2] = {0, 0};     // A・Bのpoint
    std::cin >> n >> w >> h;
    std::vector<int> a(n, 0), b(n, 0), x(n, 0);
    std::vector<long long> hv(w, 0);
    std::vector<bool> hflag(w, false);
    int f = 0;
    for (int i = 0; i < n; i++) {
        std::cin >> a[i] >> b[i] >> x[i];
    }
    for (int i = 0; i < n; i++) {
        int t = i % 2;
        int l = x[i] - 1;
        int r = l + a[i];
        for (int j = l; j < r; j++) {
            hv[j] += b[i];
            if (!hflag[j] && hv[j] > h) {
                    hflag[j] = true;
                    p[t]++;
                    f++;
                }
        }
        if (f == w) {
            break;
        }
    }
    if (p[0] == p[1]) {
        std::cout << "DRAW" << std::endl;
    } else if (p[0] > p[1]) {
        std::cout << "A" << std::endl;
    } else {
        std::cout << "B" << std::endl;
    }
}
0