Submission #12088528


Source Code Expand

Copy
#include<bits/stdc++.h>

int main(){
    using namespace std;
    unsigned long N, M;
    cin >> N >> M;
    unsigned long O{0};
    for(unsigned long i{0}, A; i < M; ++i){
        cin >> A;
        O += A;
    }
    if(O > N)puts("-1");
    else cout << N - O << endl;
    return 0;
}

Submission Info

Submission Time
Task B - Homework
User MMNMM
Language C++ (GCC 9.2.1)
Score 200
Code Size 299 Byte
Status AC
Exec Time 11 ms
Memory 3676 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 3524 KB
hand_02 AC 2 ms 3440 KB
random_01 AC 6 ms 3552 KB
random_02 AC 3 ms 3632 KB
random_03 AC 3 ms 3400 KB
random_04 AC 2 ms 3612 KB
random_05 AC 2 ms 3392 KB
random_06 AC 2 ms 3620 KB
random_07 AC 2 ms 3676 KB
random_08 AC 7 ms 3620 KB
random_09 AC 7 ms 3592 KB
random_10 AC 11 ms 3564 KB
sample_01 AC 2 ms 3580 KB
sample_02 AC 2 ms 3520 KB
sample_03 AC 2 ms 3524 KB
sample_04 AC 2 ms 3536 KB