Submission #16817

#TimeUsernameProblemLanguageResultExecution timeMemory
16817kdh9949속이기 (GA5_fake)C++98
Compilation error
0 ms0 KiB
#include<stdio.h> int n,k,xorsum,sum,max; int main() { scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&k); xorsum^=k; sum+=k; if(min<k)min=k; } printf("%d",xorsum?-1:sum-min); }

Compilation message (stderr)

fake.cpp: In function ‘int main()’:
fake.cpp:10:8: error: ‘min’ was not declared in this scope
     if(min<k)min=k;
        ^
fake.cpp:12:29: error: ‘min’ was not declared in this scope
   printf("%d",xorsum?-1:sum-min);
                             ^
fake.cpp:5:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&n);
                 ^
fake.cpp:7:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&k);
                  ^