#2343. 排列游戏

排列游戏

排列游戏

题目描述

排列游戏 - Problem - QOJ.ac

Login

Register

QOJ.ac

QOJ

[QOJ](//qoj.ac)

Contests

Category

Problems

Submissions

Hack!

Blogs

Day 1

		Time Limit:			2 s		
			Memory Limit:			1024 MB		
			Total points:			100		
					
		Difficulty: 
		[show]

3

					Interactive

				2026 二十七省联合省队选拔 Day 2				

		A.
		排列游戏		

	



[
	Statistics	](/contest/3494/problem/17304/statistics)





	[
		Statement		](#tab-statement)

			

[ Languages](#)


	[Default](/contest/3494/problem/17304/statement/default)
	

							[English](/contest/3494/problem/17304/statement/en)

Submit

Custom Test

Attachments

Discussions & Issues 1

Back to the contest

					**This problem is prepared by 

gyh20 and xtqqwq .**

	The problem is available in the following languages:
	**C++**	

Submit

Run

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions

#1276EditorialOpen《排列游戏》解题报告Qingyu2026-03-15 04:02:43View

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0

No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.

Do not submit duplicated issues.

Issues must be filed in English or Chinese only.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.

					 English					
				

				[العربية](//qoj.ac/contest/3494/problem/17304?locale=ar)
					[English](//qoj.ac/contest/3494/problem/17304?locale=en)
					[Español](//qoj.ac/contest/3494/problem/17304?locale=es)
					[Français](//qoj.ac/contest/3494/problem/17304?locale=fr)
					[日本語](//qoj.ac/contest/3494/problem/17304?locale=ja)
					[한국어](//qoj.ac/contest/3494/problem/17304?locale=ko)
						[Türkçe](//qoj.ac/contest/3494/problem/17304?locale=tr)
						[简体中文](//qoj.ac/contest/3494/problem/17304?locale=zh-cn)
					[繁體中文](//qoj.ac/contest/3494/problem/17304?locale=zh-tw)

QOJ.ac | QOJ 4.5.49 (2019-2026)

Made with ❤️ by Qingyu✨ | Contact us: [email protected]

Server Time: 2026-11-09 01:29:34 (UTC+8)

输入格式

(见题面原文)

输出格式

(见题面原文)

数据范围

(见题面原文)

样例

样例 1

0 1
6
4 2 3 5 0 1
Correct.
4

样例 2

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