Submission #12160595


Source Code Expand

#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>
#include <bitset>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 998244353;
const long long INF = 1e18;
typedef long long LL;
typedef long double LD;
typedef pair<LL, LL> PLL;
typedef pair<LD, LL> pdl;
typedef pair<LD, LD> pdd;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned long long ULL;
//typedef boost::multiprecision::cpp_int bigint;

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	LL N, M;
	cin >> N >> M;
	LL sum = 0;
	for (LL m = 0; m < M; m++) {
		LL a;
		cin >> a;
		sum += a;
	}
	if (sum > N)cout << "-1\n";
	else cout << N - sum << "\n";
	return 0;
}

Submission Info

Submission Time
Task B - Homework
User ano3
Language C++ (Clang 10.0.0)
Score 200
Code Size 1163 Byte
Status AC
Exec Time 9 ms
Memory 3196 KiB

Compile Error

./Main.cpp:29:17: warning: unused variable 'MOD' [-Wunused-const-variable]
const long long MOD = 998244353;
                ^
./Main.cpp:30:17: warning: unused variable 'INF' [-Wunused-const-variable]
const long long INF = 1e18;
                ^
2 warnings generated.

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 4 ms 3100 KiB
hand_02 AC 2 ms 3016 KiB
random_01 AC 9 ms 2844 KiB
random_02 AC 6 ms 3040 KiB
random_03 AC 5 ms 2940 KiB
random_04 AC 2 ms 3016 KiB
random_05 AC 2 ms 2884 KiB
random_06 AC 2 ms 3004 KiB
random_07 AC 2 ms 3012 KiB
random_08 AC 7 ms 2888 KiB
random_09 AC 7 ms 3196 KiB
random_10 AC 9 ms 3028 KiB
sample_01 AC 2 ms 3112 KiB
sample_02 AC 2 ms 3032 KiB
sample_03 AC 2 ms 3048 KiB
sample_04 AC 2 ms 3168 KiB