| 记录编号 | 590966 | 评测结果 | AAAATTTTTT | ||
|---|---|---|---|---|---|
| 题目名称 | 3354.[USACO20 Feb Silver]Swapity Swapity Swap | 最终得分 | 40 | ||
| 用户昵称 | 是否通过 | 未通过 | |||
| 代码语言 | C++ | 运行时间 | 12.570 s | ||
| 提交时间 | 2024-07-14 14:46:33 | 内存使用 | 3.39 MiB | ||
#include <iostream>
#include <fstream>
#include <algorithm>
#define fo(i, l, r) for(int i = (l); i <= (r); i++)
using namespace std;
int n, m, k;
int L[110], R[110], a[100010];
int main(){
freopen("usaco_Feb_swap.in", "r", stdin);
freopen("usaco_Feb_swap.out", "w", stdout);
cin >> n >> m >> k;
fo(i, 1, n) a[i] = i;
fo(i, 1, m) cin >> L[i] >> R[i];
while(k--) fo(i, 1, m) reverse(a + L[i], a + R[i] + 1);
fo(i, 1, n) cout << a[i] << endl;
return 0;
}