Submission #649500

# Submission time Handle Problem Language Result Execution time Memory
649500 2022-10-10T10:05:25 Z berr XOR Sum (info1cup17_xorsum) C++17
18 / 100
1577 ms 25956 KB
	#include <bits/stdc++.h>
	using namespace std;


	int main()
	{
		ios_base::sync_with_stdio(false);

		cin.tie(0);



		int n; cin>>n;

		if(n<=4e3)
		{
			int ans=0;

			vector<int> a(n);

			for(int i=0; i<n; i++) cin>>a[i];
			for(int i=0; i<n; i++)
			{
				for(int l=i; l<n; l++)
				{
					ans^=(a[i]+a[l]);

				}
				
			}

			cout<<ans;
		}
		else
		{
			int ans=0;
			map<int, int> a;

			for(int i=0; i<n; i++){ int x; cin>>x; a[x]++;}

			for(int i=0; i<5e3; i++)
			{
				for(int l=i; l<5e3; l++)
				{
					if(a.count(i)==0) continue;
					if(a.count(l)==0) continue;
				
					if(l==i)
					{
						
						if((a[l]*(a[l])-((a[l]*(a[l]-1))/2))%2) ans^=(l+i);
						
					}
					else
					{
					
						if((a[l]*a[i])%2) ans^=(l+i);
					}

					
				}
			}

			cout<<ans;
		}
	}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 212 KB Output is correct
2 Correct 5 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1122 ms 488 KB Output is correct
2 Correct 1086 ms 612 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1122 ms 488 KB Output is correct
2 Correct 1086 ms 612 KB Output is correct
3 Incorrect 1577 ms 25956 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 212 KB Output is correct
2 Correct 5 ms 212 KB Output is correct
3 Incorrect 243 ms 4988 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 212 KB Output is correct
2 Correct 5 ms 212 KB Output is correct
3 Correct 1122 ms 488 KB Output is correct
4 Correct 1086 ms 612 KB Output is correct
5 Incorrect 1577 ms 25956 KB Output isn't correct
6 Halted 0 ms 0 KB -