제출 #344188

#제출 시각아이디문제언어결과실행 시간메모리
344188NurlykhanIntergalactic ship (IZhO19_xorsum)C++17
0 / 100
2072 ms1900 KiB
#include <bits/stdc++.h> using namespace std; const int N = (int)1e5 + 10; const int mod = (int)1e9 + 7; int n, q; int a[N], b[N]; int l[N], r[N], x[N], xr[N]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); scanf("%d", &q); for (int i = 0; i < q; i++) scanf("%d%d%d", &l[i], &r[i], &x[i]); int ans = 0; for (int i = 0; i < (1 << q); i++) { for (int j = 0; j < q; j++) { xr[j] = 0; } for (int j = 0; j < q; j++) { if ((i >> j) % 2) { xr[l[j]] ^= x[j]; xr[r[j] + 1] ^= x[j]; } } for (int i = 1; i <= n; i++) { xr[i] ^= xr[i - 1]; b[i] = a[i] ^ xr[i]; } for (int i = 1; i <= n; i++) { int s = 0; for (int j = i; j <= n; j++) { s += b[j]; (ans += (s * 1ll * s) % mod) %= mod; } } } cout << ans; return 0; }

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

xorsum.cpp: In function 'int main()':
xorsum.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   13 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
xorsum.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   15 |         scanf("%d", &a[i]);
      |         ~~~~~^~~~~~~~~~~~~
xorsum.cpp:16:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   16 |     scanf("%d", &q);
      |     ~~~~~^~~~~~~~~~
xorsum.cpp:18:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   18 |         scanf("%d%d%d", &l[i], &r[i], &x[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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...