제출 #67813

#제출 시각아이디문제언어결과실행 시간메모리
67813ege_eksiXOR Sum (info1cup17_xorsum)C++14
7 / 100
1666 ms8932 KiB
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<algorithm>

using namespace std;

int *v;

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

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

xorsum.cpp: In function 'int main()':
xorsum.cpp:14:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
xorsum.cpp:20:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   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...