Submission #43330

#TimeUsernameProblemLanguageResultExecution timeMemory
43330HassoonyTarifa (COCI16_tarifa)C++14
50 / 50
2 ms752 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...