| 比赛 |
2026.5.16 |
评测结果 |
AEEEEEEEEE |
| 题目名称 |
序列 |
最终得分 |
10 |
| 用户昵称 |
终焉折枝 |
运行时间 |
1.391 s |
| 代码语言 |
C++ |
内存使用 |
4.06 MiB |
| 提交时间 |
2026-05-16 12:49:33 |
显示代码纯文本
#include<iostream>
using namespace std;
#define ull unsigned long long
const int N = 1005;
ull n, m, type;
ull a[N];
ull f[N][N];
int main(){
freopen("sequence.in", "r", stdin);
freopen("sequence.out", "w", stdout);
cin.tie(0) -> ios::sync_with_stdio(0);
cin >> n >> m >> type;
for(int i = 1;i <= n;i ++){
cin >> a[i];
}
for(int j = 1;j <= n;j ++){
ull mn = a[j];
ull sum = 0;
for(int i = j;i >= 1;i --){
mn = min(mn, a[i]);
sum += mn;
f[i][j] = f[i][j - 1] + sum;
}
}
ull ans = 0;
for(int i = 1;i <= m;i ++){
int l, r; cin >> l >> r;
ans ^= f[l][r];
}
cout << ans << '\n';
return 0;
}