-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeforces Round 137 (Div. 2) - B. Cosmic Tables.cpp
More file actions
59 lines (52 loc) · 1.34 KB
/
Codeforces Round 137 (Div. 2) - B. Cosmic Tables.cpp
File metadata and controls
59 lines (52 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// std::setvbuf(stdout, nullptr, _IOFBF, BUFSIZ); //(will neglect the c's stdio.h property of doing inline flushing with every line of code)
//std::ios_base::sync_with_stdio(false); // (removes the interoperability that happens between C's stdio.h and iostream )
#include <iostream>
//#include<numeric>
//#include<vector>
//#include<cmath>
//#include<stack>
//#include <iomanip>
#include <vector>
//#include<bits/stdc++.h>
//#include <bitset>
////#include<iomanip>
//#include <algorithm>
//#include<queue>
////#include<deque>
////#include<numeric>
//#include<set>
//#include<unordered_set>
//#include<map>
////#include<fstream>
//#include<sstream>
////#include <thread>
////#include <chrono>
//#include<cstring>
//#include<string>
//#include <unordered_map>
////#include <thread>
////#include<limits>+++
using namespace std;
int arr[1001][1001];
int rows[1001];
int columns[1001];
int main(){
int n,m,k;
cin>>n>>m>>k;
for(int i =1;i<=n;i++){
rows[i] =i;
for(int j=1;j<=m;j++){
scanf("%d",&arr[i][j]);
}
}
for(int j=1;j<=m;j++)columns[j]=j;
char s;
int x,y;
for(int i=0;i<k;i++){
getchar();
scanf("%c%d%d",&s,&x,&y);
if(s=='g')printf("%d\n",arr[rows[x]][columns[y]]);
else if(s =='r') swap(rows[x],rows[y]);
else swap(columns[x],columns[y]);
}
}