Submission #787144

# Submission time Handle Problem Language Result Execution time Memory
787144 2023-07-18T21:12:23 Z ThylOne XORanges (eJOI19_xoranges) C++14
30 / 100
1000 ms 1748 KB
#include<bits/stdc++.h>

using namespace std;
#define int long long
signed main(){
	int n;cin>>n;
	int q;cin>>q;
	vector<int> nums(n);
	for(int i = 0 ; i < n ; i++){
		cin>>nums[i];
	}
	for(int _=0;_<q;_++){
		int type;cin>>type;
		if(type==1){
			int pos;cin>>pos;pos--;
			int val;cin>>val;
			nums[pos]=val;
		}else{
			int l,r;cin>>l>>r;
			l--;r--;
			int ans=0;
			
			for(int i = l;i<=r;i++){
				int act=0;
				for(int j=i;j<=r;j++){
					act^=nums[j];
					
					ans^=act;
				}
			}
			cout<<ans<<endl;
		}
	}
	return 0;
}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 212 KB Output is correct
2 Correct 6 ms 212 KB Output is correct
3 Correct 7 ms 212 KB Output is correct
4 Correct 26 ms 312 KB Output is correct
5 Correct 29 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 8 ms 212 KB Output is correct
7 Correct 6 ms 212 KB Output is correct
8 Correct 7 ms 212 KB Output is correct
9 Correct 26 ms 312 KB Output is correct
10 Correct 29 ms 212 KB Output is correct
11 Execution timed out 1070 ms 444 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1069 ms 1748 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 8 ms 212 KB Output is correct
7 Correct 6 ms 212 KB Output is correct
8 Correct 7 ms 212 KB Output is correct
9 Correct 26 ms 312 KB Output is correct
10 Correct 29 ms 212 KB Output is correct
11 Execution timed out 1070 ms 444 KB Time limit exceeded
12 Halted 0 ms 0 KB -