-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawingLots.cpp
More file actions
54 lines (46 loc) · 842 Bytes
/
DrawingLots.cpp
File metadata and controls
54 lines (46 loc) · 842 Bytes
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
/*
* Aizu 0011
* Created by Ziyi Tang
* Basic Array Operation
*/
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
using namespace std;
#define INF (int)1E9
#define INFL (long)1E18
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef vector<vpi> vvpi;
const int dir[4][2] = {{1,0},{-1,0},{0,1},{0,-1}};
int all[35];
int main(){
int v,h;
cin >> v >> h;
for (int i = 1; i <= v; i++){
all[i] = i;
}
int a,b;
for (int i = 0; i < h; i++){
scanf("%d,%d",&a,&b);
int tmp = all[a];
all[a] = all[b];
all[b] = tmp;
}
for (int i = 1; i <= v; i++){
cout << all[i] << endl;
}
return 0;
}