Submission #12094864


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mod 1000000007
#define pb push_back
#define pi pair<int,int>
#define vi vector<int>
#define vpi vector< pi > 
#define IOS ios_base::sync_with_stdio(false),cin.tie(NULL)
const int N=500003;
int main()
{
	int n,m;
	cin>>n>>m;
	while(m--)
	{
		int x;
		cin>>x;
		n-=x;
	}
	if(n<0) n=-1;
	cout<<n;
	return 0;
}

Submission Info

Submission Time
Task B - Homework
User sarwarkhan
Language C++ (GCC 9.2.1)
Score 200
Code Size 406 Byte
Status AC
Exec Time 11 ms
Memory 3624 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 16
Set Name Test Cases
Sample sample_01, sample_02, sample_03, sample_04
All hand_01, hand_02, random_01, random_02, random_03, random_04, random_05, random_06, random_07, random_08, random_09, random_10, sample_01, sample_02, sample_03, sample_04
Case Name Status Exec Time Memory
hand_01 AC 11 ms 3592 KB
hand_02 AC 2 ms 3452 KB
random_01 AC 4 ms 3624 KB
random_02 AC 3 ms 3432 KB
random_03 AC 3 ms 3584 KB
random_04 AC 3 ms 3520 KB
random_05 AC 2 ms 3620 KB
random_06 AC 2 ms 3452 KB
random_07 AC 2 ms 3524 KB
random_08 AC 4 ms 3548 KB
random_09 AC 7 ms 3568 KB
random_10 AC 4 ms 3392 KB
sample_01 AC 2 ms 3588 KB
sample_02 AC 2 ms 3444 KB
sample_03 AC 2 ms 3624 KB
sample_04 AC 2 ms 3452 KB