提出 #68152570


ソースコード 拡げる

#include <iostream>
#include <vector>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<int> A(n), B(n), P(n);

    for(int i = 0; i < n; i++){
        cin >> P[i] >> A[i] >> B[i];
    }

    int q;
    cin >> q;
    
    vector<int> X(q);
    for(int i = 0; i < q; i++){
        cin >> X[i];
        int tention = X[i];
        
        //
        for(int j = 0; j < n; j++){
            if(tention <= P[j]){
                tention += A[j];
            }else {
                tention -= B[j];
                if(tention < 0){
                    tention = 0;
                }
            }
        }

        cout << tention << endl;
    }

    return 0;
}

提出情報

提出日時
問題 D - Takahashi's Expectation
ユーザ Nishiki_1
言語 C++ 20 (gcc 12.2)
得点 0
コード長 715 Byte
結果 TLE
実行時間 2214 ms
メモリ 7336 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 425
結果
AC × 3
AC × 10
TLE × 20
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 01_random_28.txt, 01_random_29.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3524 KiB
00_sample_01.txt AC 1 ms 3528 KiB
00_sample_02.txt AC 1 ms 3456 KiB
01_random_03.txt TLE 2210 ms 5532 KiB
01_random_04.txt TLE 2210 ms 5524 KiB
01_random_05.txt TLE 2211 ms 5540 KiB
01_random_06.txt TLE 2210 ms 5532 KiB
01_random_07.txt TLE 2210 ms 5512 KiB
01_random_08.txt TLE 2210 ms 5484 KiB
01_random_09.txt TLE 2210 ms 5528 KiB
01_random_10.txt TLE 2211 ms 5512 KiB
01_random_11.txt TLE 2210 ms 5508 KiB
01_random_12.txt TLE 2210 ms 5528 KiB
01_random_13.txt TLE 2211 ms 5528 KiB
01_random_14.txt TLE 2211 ms 5520 KiB
01_random_15.txt TLE 2210 ms 5508 KiB
01_random_16.txt AC 540 ms 3880 KiB
01_random_17.txt AC 269 ms 3864 KiB
01_random_18.txt TLE 2214 ms 6148 KiB
01_random_19.txt AC 265 ms 3432 KiB
01_random_20.txt AC 568 ms 3628 KiB
01_random_21.txt AC 1795 ms 7020 KiB
01_random_22.txt AC 689 ms 7336 KiB
01_random_23.txt AC 447 ms 4224 KiB
01_random_24.txt TLE 2209 ms 5528 KiB
01_random_25.txt TLE 2209 ms 5508 KiB
01_random_26.txt TLE 2210 ms 5532 KiB
01_random_27.txt TLE 2210 ms 5524 KiB
01_random_28.txt TLE 2210 ms 5516 KiB
01_random_29.txt TLE 2214 ms 5520 KiB