답안 #395178

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
395178 2021-04-28T00:29:11 Z NekoRolly Intergalactic ship (IZhO19_xorsum) C++17
9 / 100
2000 ms 1508 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll M = 1e5+7;
const ll inf = 1e9;
const ll mod = 1e9+7;

int n,q;
int a[M],l[M],r[M],x[M];
ll b[M];
ll ans;

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);

	cin >> n;
	for (int i=1; i<=n; i++) cin >> a[i];
	cin >> q;
	for (int i=0; i<q; i++) cin >> l[i] >> r[i] >> x[i];

	for (int m=0; m<(1<<q); m++){
		for (int i=1; i<=n; i++) b[i] = 0;

		for (int i=0; i<q; i++)
			if (1<<i&m) b[l[i]] ^= x[i], b[r[i]+1] ^= x[i];

		for (int i=1; i<=n; i++) b[i] ^= b[i-1];
		for (int i=1; i<=n; i++) b[i] ^= a[i];
		for (int i=1; i<=n; i++) for (int j=1; j<=n; j++) ans = (ans + b[i]*b[j]*min(i,j)*(n-max(i,j)+1))%mod;
	}

	cout << ans << "\n";

	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 48 ms 332 KB Output is correct
7 Correct 48 ms 332 KB Output is correct
8 Correct 48 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 20 ms 1508 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2084 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2090 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2090 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 48 ms 332 KB Output is correct
7 Correct 48 ms 332 KB Output is correct
8 Correct 48 ms 332 KB Output is correct
9 Execution timed out 2090 ms 332 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 48 ms 332 KB Output is correct
7 Correct 48 ms 332 KB Output is correct
8 Correct 48 ms 332 KB Output is correct
9 Execution timed out 2090 ms 332 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 48 ms 332 KB Output is correct
7 Correct 48 ms 332 KB Output is correct
8 Correct 48 ms 332 KB Output is correct
9 Incorrect 20 ms 1508 KB Output isn't correct
10 Halted 0 ms 0 KB -