Submission #12117261


Source Code Expand

Copy
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr long double EPS = 1e-8;

long long int N, M, K, L, R, H, W;
//int N, M, K, L, R, H, W;


int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		cin >> K;
		N -= K;
	}
	N = max(N, -1LL);
	cout << N << endl;
}

Submission Info

Submission Time
Task B - Homework
User olphe
Language C++ (GCC 9.2.1)
Score 200
Code Size 862 Byte
Status AC
Exec Time 3 ms
Memory 3656 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 2 ms 3540 KB
hand_02 AC 2 ms 3652 KB
random_01 AC 3 ms 3488 KB
random_02 AC 3 ms 3544 KB
random_03 AC 2 ms 3572 KB
random_04 AC 2 ms 3600 KB
random_05 AC 2 ms 3588 KB
random_06 AC 2 ms 3540 KB
random_07 AC 2 ms 3532 KB
random_08 AC 3 ms 3608 KB
random_09 AC 3 ms 3516 KB
random_10 AC 3 ms 3656 KB
sample_01 AC 2 ms 3512 KB
sample_02 AC 2 ms 3528 KB
sample_03 AC 2 ms 3488 KB
sample_04 AC 2 ms 3580 KB