제출 #559605

#제출 시각아이디문제언어결과실행 시간메모리
559605StavabXORanges (eJOI19_xoranges)C++14
55 / 100
1061 ms3540 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, q; scanf("%d %d", &n, &q); vector<int> oranges(n + 5, 0); for(int i = 1; i <= n; i++) { scanf("%d", &oranges[i]); } int move; while(q--) { scanf("%d", &move); if(move == 1) { int pos, val; scanf("%d %d", &pos, &val); oranges[pos] = val; } else { int l, u; scanf("%d %d", &l, &u); int ans = 0; for(int i = l; i <= u; i++) { if ((i-l+1)*((u-l+1)-(i-l)) % 2 == 1) { ans = ans ^ oranges[i]; } } printf("%d\n", ans); } } return 0; }

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

xoranges.cpp: In function 'int main()':
xoranges.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     scanf("%d %d", &n, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~~
xoranges.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scanf("%d", &oranges[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~
xoranges.cpp:20:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |         scanf("%d", &move);
      |         ~~~~~^~~~~~~~~~~~~
xoranges.cpp:25:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |             scanf("%d %d", &pos, &val);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~
xoranges.cpp:32:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |             scanf("%d %d", &l, &u);
      |             ~~~~~^~~~~~~~~~~~~~~~~
#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...