QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#96681#5484. Ghost Legmonkedluffy#AC ✓2ms3428kbC++23586b2023-04-15 02:08:442023-04-15 02:08:55

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-15 02:08:55]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3428kb
  • [2023-04-15 02:08:44]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define ll long long

void solve(){
    int n, m; cin >> n >> m;
    vector<int> ans(n);
    iota(ans.begin(), ans.end(), 1);
    for(int i = 0; i < m; i++) {
        int a; cin >> a; a--;
        int u = a, v = a + 1;
        swap(ans[u], ans[v]);
    }
    for(int i = 0; i < n; i++) cout << ans[i] << '\n';
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
    //cin >> t;
    while(t--){
        cout << fixed << setprecision(15);
        solve();
    }

    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3356kb

input:

4 5
1
2
1
3
2

output:

3
4
2
1

result:

ok 4 lines

Test #2:

score: 0
Accepted
time: 2ms
memory: 3300kb

input:

7 6
6
4
2
1
3
5

output:

3
1
5
2
7
4
6

result:

ok 7 lines

Test #3:

score: 0
Accepted
time: 2ms
memory: 3308kb

input:

8 21
5
4
1
6
3
7
1
2
4
6
3
1
7
5
4
6
3
1
2
5
7

output:

1
8
6
4
5
2
7
3

result:

ok 8 lines

Test #4:

score: 0
Accepted
time: 0ms
memory: 3296kb

input:

68 392
15
55
14
39
67
7
34
60
53
22
19
24
53
40
61
19
3
28
57
54
36
52
55
43
33
24
65
59
48
6
33
12
10
63
1
9
19
34
2
4
5
37
44
57
9
38
26
11
15
15
14
67
16
1
42
48
24
39
56
21
62
38
49
4
50
49
13
2
32
31
22
37
67
66
43
25
36
1
35
50
16
65
66
48
65
40
46
38
29
51
58
23
22
56
43
4
38
5
22
19
35
44
55...

output:

5
3
1
2
8
6
11
4
9
7
12
10
16
18
14
19
13
17
20
15
23
21
22
25
27
24
29
30
32
28
26
33
31
35
41
40
38
37
34
43
44
39
45
51
47
36
49
50
48
42
56
46
52
53
55
54
64
59
57
58
61
60
65
68
66
63
62
67

result:

ok 68 lines

Test #5:

score: 0
Accepted
time: 2ms
memory: 3428kb

input:

89 975
62
38
16
41
43
66
77
3
50
80
9
16
35
55
4
38
3
63
19
31
74
10
70
50
80
21
68
84
43
68
50
17
81
65
57
35
18
22
37
68
13
46
59
23
76
38
36
54
12
54
84
62
40
41
87
31
61
66
2
16
21
27
8
13
3
40
24
85
37
60
40
25
81
10
48
45
23
83
10
34
25
70
7
64
22
5
70
59
46
71
50
66
9
57
55
75
72
78
71
21
25
...

output:

7
2
1
10
9
4
11
6
3
15
5
12
14
13
20
16
19
8
25
23
18
26
17
28
22
30
21
24
29
36
31
27
38
34
32
42
33
40
37
39
46
35
43
41
57
49
47
52
45
48
64
44
51
50
53
55
54
61
60
65
59
62
56
63
58
73
72
66
67
68
71
82
69
77
78
70
74
76
75
83
81
79
88
86
89
80
84
85
87

result:

ok 89 lines

Test #6:

score: 0
Accepted
time: 2ms
memory: 3388kb

input:

98 445
21
20
96
2
62
91
29
24
73
13
1
91
59
42
9
59
83
21
28
75
61
38
40
95
57
47
49
72
54
52
80
74
5
78
10
67
6
38
24
78
82
56
6
74
97
14
36
16
34
63
90
94
4
63
25
60
43
73
65
96
58
47
7
62
27
16
62
32
84
20
13
2
75
18
76
8
62
14
23
29
10
46
25
44
42
49
37
85
55
4
17
15
50
23
10
77
38
72
42
56
91
5...

output:

3
2
4
1
5
9
6
7
12
10
17
11
8
13
14
16
15
20
21
19
18
22
25
24
23
27
30
26
29
31
32
33
34
37
35
28
36
39
43
38
44
41
42
45
47
49
40
51
48
46
50
52
58
54
55
56
53
57
59
60
68
67
63
62
64
61
69
66
65
71
74
70
77
72
73
76
79
81
80
78
75
82
84
86
88
92
85
83
87
91
89
90
94
93
97
96
98
95

result:

ok 98 lines

Test #7:

score: 0
Accepted
time: 0ms
memory: 3372kb

input:

100 1000
4
28
88
63
61
90
89
48
85
83
2
82
58
82
40
10
76
44
67
44
83
90
66
87
47
70
56
69
20
43
82
23
70
68
84
30
57
73
77
42
57
77
22
13
59
59
20
34
4
87
75
84
75
42
71
22
10
27
90
30
69
70
52
38
38
36
67
94
8
44
34
64
21
54
74
78
13
93
10
14
78
84
97
53
24
66
74
32
92
62
61
60
32
13
95
68
47
62
6...

output:

1
8
2
10
6
4
5
7
3
12
15
22
17
9
14
13
11
16
20
19
18
23
29
26
21
27
28
31
30
24
35
34
36
33
32
25
41
37
39
43
38
46
42
47
40
45
44
50
51
57
49
48
56
54
53
55
60
59
52
63
64
70
74
65
58
62
61
67
72
75
71
73
78
68
80
69
66
79
81
77
76
86
84
82
89
83
88
87
85
98
92
93
91
97
94
96
100
95
90
99

result:

ok 100 lines

Test #8:

score: 0
Accepted
time: 2ms
memory: 3308kb

input:

1 0

output:

1

result:

ok single line: '1'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3376kb

input:

5 0

output:

1
2
3
4
5

result:

ok 5 lines