Submission #34203983


Source Code Expand

#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
using namespace std;

long long n, m, t;
int arr[100010];
int add[100010];

int main()
{
	int i;
	int a, b;

	cin >> n >> m >> t;
	for (i = 2; i <= n; i++)
	{
		cin >> arr[i];
	}
	for (i = 0; i < m; i++)
	{
		cin >> a >> b;

		add[a] = b;
	}

	for (i = 1; i <= n; i++)
	{
		t -= arr[i];

		if (t <= 0)
		{
			cout << "No";
			return 0;
		}

		t += add[i];
	}

	cout << "Yes";
}

Submission Info

Submission Time
Task B - Explore
User gojib2002
Language C++ (GCC 9.2.1)
Score 200
Code Size 574 Byte
Status AC
Exec Time 86 ms
Memory 4340 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 8 ms 3504 KiB
random_01.txt AC 86 ms 4148 KiB
random_02.txt AC 23 ms 3736 KiB
random_03.txt AC 84 ms 4280 KiB
random_04.txt AC 14 ms 3508 KiB
random_05.txt AC 79 ms 4336 KiB
random_06.txt AC 31 ms 3696 KiB
random_07.txt AC 79 ms 4212 KiB
random_08.txt AC 42 ms 3840 KiB
random_09.txt AC 78 ms 4340 KiB
random_10.txt AC 45 ms 3760 KiB
random_11.txt AC 82 ms 4268 KiB
random_12.txt AC 30 ms 3588 KiB
random_13.txt AC 78 ms 4268 KiB
random_14.txt AC 40 ms 3908 KiB
random_15.txt AC 78 ms 4288 KiB
random_16.txt AC 42 ms 3796 KiB
random_17.txt AC 81 ms 4260 KiB
random_18.txt AC 77 ms 4260 KiB
random_19.txt AC 78 ms 4260 KiB
random_20.txt AC 46 ms 3912 KiB
random_21.txt AC 2 ms 3440 KiB
random_22.txt AC 2 ms 3500 KiB
random_23.txt AC 2 ms 3484 KiB
sample_01.txt AC 3 ms 3520 KiB
sample_02.txt AC 2 ms 3508 KiB