제출 #976820

#제출 시각아이디문제언어결과실행 시간메모리
976820IsamXORanges (eJOI19_xoranges)C++17
55 / 100
1064 ms3924 KiB
#include<bits/stdc++.h>
using namespace std;

constexpr int sz = 2e5 + 5;

int n, q, a[sz];

signed main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
	cin >> n >> q;
	for(register int i = 1; i <= n; ++i){
		cin >> a[i];
	}
	
	
	
	
	int type, l, r;
		
	while(q--){
		cin >> type >> l >> r;
		if(type == 1){
			a[l] = r;
		}else{
			int ans(0);
			for(register int i = l; i <= r; ++i){
				
				int x = ((i - l + 1) & 1) * ((r - i + 1) & 1);
				if(x & 1) ans ^= a[i];
				
			}
			
			cout << ans << '\n';
			
		}
		
	}
	
	
	
	
}

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

xoranges.cpp: In function 'int main()':
xoranges.cpp:11:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   11 |  for(register int i = 1; i <= n; ++i){
      |                   ^
xoranges.cpp:26:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   26 |    for(register int i = l; i <= r; ++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...