Submission #43330

# Submission time Handle Problem Language Result Execution time Memory
43330 2018-03-13T19:06:52 Z Hassoony Tarifa (COCI16_tarifa) C++14
50 / 50
2 ms 752 KB
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int MX=3e5+9;
int n,x,a,megab;
int main(){
    scanf("%d%d",&x,&n);
    megab=x;
    while(n--){
        scanf("%d",&a);
        megab-=a;
        megab+=x;
    }
    cout<<megab<<endl;
}

Compilation message

tarifa.cpp: In function 'int main()':
tarifa.cpp:8:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&x,&n);
                        ^
tarifa.cpp:11:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&a);
                       ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 248 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 2 ms 484 KB Output is correct
4 Correct 1 ms 484 KB Output is correct
5 Correct 2 ms 524 KB Output is correct
6 Correct 2 ms 616 KB Output is correct
7 Correct 1 ms 724 KB Output is correct
8 Correct 1 ms 724 KB Output is correct
9 Correct 2 ms 724 KB Output is correct
10 Correct 2 ms 752 KB Output is correct