제출 #445564

#제출 시각아이디문제언어결과실행 시간메모리
445564aris12345678XORanges (eJOI19_xoranges)C++14
30 / 100
1085 ms3220 KiB
#include <bits/stdc++.h> using namespace std; const int mxN = 2*1e5+5; int a[mxN]; int main() { int n, q; scanf("%d %d", &n, &q); for(int i = 0; i < n; i++) scanf("%d", &a[i]); while(q--) { int type, l, r; scanf("%d %d %d", &type, &l, &r); if(type == 1) a[l-1] = r; else { int ans = 0; for(int i = l-1; i < r; i++) { int res = 0; for(int j = i; j < r; j++) { res ^= a[j]; ans ^= res; } } printf("%d\n", ans); } } return 0; }

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

xoranges.cpp: In function 'int main()':
xoranges.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d %d", &n, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~~
xoranges.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |         scanf("%d", &a[i]);
      |         ~~~~~^~~~~~~~~~~~~
xoranges.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scanf("%d %d %d", &type, &l, &r);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...