Submission #34215796


Source Code Expand

#include"bits/stdc++.h"

using namespace std;


int main() {
    // freopen("B.in" , "r" , stdin);
    // freopen("B.out" , "w" , stdout);
    int n, m;
    long long t;
    cin >> n >> m >> t;
    vector<int> a(n), f(n+1,0);
    for (int i = 1; i < n; ++i) cin >> a[i];
    for (int i = 0; i < m; ++i) {
        int x, y;
        cin >> x >> y;
        f[x] = y;
    }
    int tmp = 1;
    while (tmp < n && t > 0) {
        t -= a[tmp];
        if (t <= 0) break;
        t += f[++tmp];
    }
    if (t <= 0) cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}

Submission Info

Submission Time
Task B - Explore
User ZzZZCHS
Language C++ (GCC 9.2.1)
Score 200
Code Size 611 Byte
Status AC
Exec Time 82 ms
Memory 4024 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 26
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All hand_01.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
hand_01.txt AC 4 ms 3604 KiB
random_01.txt AC 80 ms 3860 KiB
random_02.txt AC 23 ms 3688 KiB
random_03.txt AC 82 ms 3804 KiB
random_04.txt AC 14 ms 3492 KiB
random_05.txt AC 76 ms 3960 KiB
random_06.txt AC 27 ms 3612 KiB
random_07.txt AC 76 ms 3800 KiB
random_08.txt AC 47 ms 3540 KiB
random_09.txt AC 78 ms 3940 KiB
random_10.txt AC 43 ms 3560 KiB
random_11.txt AC 76 ms 4024 KiB
random_12.txt AC 30 ms 3692 KiB
random_13.txt AC 76 ms 3872 KiB
random_14.txt AC 42 ms 3576 KiB
random_15.txt AC 77 ms 3964 KiB
random_16.txt AC 41 ms 3572 KiB
random_17.txt AC 77 ms 3960 KiB
random_18.txt AC 75 ms 3800 KiB
random_19.txt AC 79 ms 3808 KiB
random_20.txt AC 46 ms 3608 KiB
random_21.txt AC 2 ms 3572 KiB
random_22.txt AC 3 ms 3460 KiB
random_23.txt AC 4 ms 3408 KiB
sample_01.txt AC 3 ms 3404 KiB
sample_02.txt AC 3 ms 3572 KiB