| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 498214 | sireanu_vlad | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++14 | 3076 ms | 332 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
int mod = 1e9 + 7;
int n, a[1001], q, res, s[100001][3];
void read()
{
	cin >> n;
	for(int i = 1; i <= n; ++i)
		cin >> a[i];
	cin >> q;
	for(int i = 1; i <= q; ++i)
		cin >> s[i][1] >> s[i][2] >> s[i][3];
}
void sum()
{
	for(int i = 1; i <= n; ++i)
		for(int j = i, p; j <= n; ++j)
		{
			p = 0;
			for(int k = i; k <= j; ++k)
				p = (p + a[k]) % mod;
			res = (res + (p*p%mod)) % mod;
		}
}
void up(int l, int r, int x)
{
	for(int i = l; i <= r; ++i)
		a[i] ^= x;
}
void back(int k)
{
	if(k == 0)
		sum();
	if(k > 0)
	{
		up(s[k][1], s[k][2], s[k][3]);
		back(k - 1);
		up(s[k][1], s[k][2], s[k][3]);
		back(k - 1);
	}
}
int main()
{
	read();
	back(q);
	cout << res;
	return 0;
}
컴파일 시 표준 에러 (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... | ||||
