# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
286976 | tqbfjotld | Intergalactic ship (IZhO19_xorsum) | C++14 | 2050 ms | 1536 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
///why not grab subtask
int orig[1005];
int l[100005];
int r[100005];
int v[100005];
int newv[1005];
int main(){
int n;
scanf("%d",&n);
for (int x = 1; x<=n; x++){
scanf("%d",&orig[x]);
}
int q;
scanf("%d",&q);
for (int x = 0; x<q; x++){
scanf("%d%d%d",&l[x],&r[x],&v[x]);
}
long long ans = 0;
for (int bitmask = 0; bitmask<(1<<q); bitmask++){
for (int x = 1; x<=n; x++){
newv[x] = orig[x];
}
for (int x = 0; x<q; x++){
if (bitmask & (1<<x)){
for (int y = l[x]; y<=r[x]; y++){
newv[y] ^= v[x];
}
}
}
long long something = 0;
long long tans = 0;
for (int x = 1; x<=n; x++){
tans += newv[x]*newv[x]*x*(n-x+1);
tans += 2*newv[x]*(n-x+1)*something;
tans %= 1000000007LL;
something += newv[x]*x;
something %= 1000000007LL;
}
ans += tans;
ans %= 1000000007LL;
}
printf("%lld",ans);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |