제출 #876589

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8765892023-11-22 02:49:31vjudge1Intergalactic ship (IZhO19_xorsum)C++17
100 / 100
1794 ms14920 KiB
// https://oj.uz/problem/view/IZhO19_xorsum
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
const int MOD = 1e9 + 7;
int n;
cin >> n;
vector<int> A(n);
for (int i = 0; i < n; i++) cin >> A[i];
int q;
cin >> q;
vector<int> l(q), r(q), x(q);
for (int i = 0; i < q; i++) cin >> l[i] >> r[i] >> x[i], l[i]--;
int64_t p = 1;
int64_t res = 0;
for (int i = 0; i < q; i++) (p *= 2) %= MOD;
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 7; j++) {
vector<vector<int>> cntl(n + 1, vector<int>(n + 1));
vector<vector<int>> cntr(n + 1, vector<int>(n + 1));
vector<vector<int>> cntb(n + 1, vector<int>(n + 1));
for (int z = 0; z < q; z++) {
int a = x[z] >> i & 1, b = x[z] >> j & 1;
if (a && b) {
cntb[l[z]][l[z]]++;
cntb[l[z]][r[z]]--;
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

xorsum.cpp: In function 'int32_t main()':
xorsum.cpp:90:20: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   90 |         res *= MOD + 1 >> 1;
      |                ~~~~^~~
xorsum.cpp:92:20: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   92 |         res *= MOD + 1 >> 1;
      |                ~~~~^~~
xorsum.cpp:94:20: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   94 |         res *= MOD + 1 >> 1;
      |                ~~~~^~~
#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...