Submission #90119

#TimeUsernameProblemLanguageResultExecution timeMemory
90119cs71107속이기 (GA5_fake)C++14
100 / 100
20 ms1552 KiB
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<int, pii> piii;
const int INF = 1e9+1;
const int MAXN = 1e5+10;

int main()
{
    int n,x;
    int totxor = 0;
    ll sum = 0,mn = INF;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)
    {
        scanf("%d",&x);
        totxor^=x;
        mn = min((ll)x,mn);
        sum+=(ll)x;
    }

    if(totxor)printf("0");
    else printf("%lld",sum-mn);

    return 0;
}

Compilation message (stderr)

fake.cpp: In function 'int main()':
fake.cpp:17:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
fake.cpp:21:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&x);
         ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...