제출 #412781

#제출 시각아이디문제언어결과실행 시간메모리
412781aris12345678XOR Sum (info1cup17_xorsum)C++14
7 / 100
1671 ms8744 KiB
#include <bits/stdc++.h>
using namespace std;

const int mxN = 1e6+5;
int v[mxN];

int main() {
    int n;
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
        scanf("%d", &v[i]);
    int ans = 0;
    for(int i = 0; i < n; i++) {
        for(int j = i; j < n; j++)
            ans ^= (v[i]+v[j]);
    }
    printf("%d\n", ans);
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

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