#2272. 图排列

    ID: 2272 传统题 1000ms 256MiB 尝试: 0 已通过: 0 难度: NOI/NOI+/CTS 上传者: 标签>PROV赛事:contest1929来源:qoj.ac数据:公开样例拓扑排序

图排列

图排列

题目描述

图排列 - 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:			512 MB		
			Total points:			100		

				2025 二十六省联合省队选拔 Day 1				

		C.
		图排列		

	



[
	Statistics	](/contest/1929/problem/10149/statistics)





	[
		Statement		](#tab-statement)

			

[ Languages](#)


	[Default](/contest/1929/problem/10149/statement/default)
	

							[English](/contest/1929/problem/10149/statement/en)

Submit

Custom Test

Attachments

Discussions & Issues 1

Back to the contest

					**This problem is prepared by 

xiaolilsq .**

Submit

Run

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions

EditorialOpen** Official Editorial**Qingyu- Download

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/1929/problem/10149?locale=ar)
					[English](//qoj.ac/contest/1929/problem/10149?locale=en)
					[Español](//qoj.ac/contest/1929/problem/10149?locale=es)
					[Français](//qoj.ac/contest/1929/problem/10149?locale=fr)
					[日本語](//qoj.ac/contest/1929/problem/10149?locale=ja)
					[한국어](//qoj.ac/contest/1929/problem/10149?locale=ko)
						[Türkçe](//qoj.ac/contest/1929/problem/10149?locale=tr)
						[简体中文](//qoj.ac/contest/1929/problem/10149?locale=zh-cn)
					[繁體中文](//qoj.ac/contest/1929/problem/10149?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:11 (UTC+8)

输入格式

(见题面原文)

输出格式

(见题面原文)

数据范围

(见题面原文)

样例

样例 1

0 2
4 2
1 3
4 2
4 5
2 3
4 2
3 1
1 4
3 4
1 2 4 3
1 3 2 4

样例 2

0 10
10 0
10 2
7 5
3 4
10 4
5 6
5 8
4 10
5 2
10 4
9 10
5 4
5 3
10 2
10 9
1 4
1 9
10 8
7 1
2 10
6 10
9 6
8 3
9 2
10 10
2 3
10 8
1 8
3 8
3 1
5 2
10 9
6 7
4 2
5 8
10 11
3 6
4 9
1 7
9 6
6 7
1 9
2 3
7 8
2 8
2 6
7 10
10 12
2 7
5 7
9 5
9 8
5 2
7 4
8 6
8 3
6 5
4 6
8 1
6 7
10 16
3 5
2 3
7 5
9 10
3 7
1 4
9 6
3 10
1 8
3 4
3 8
6 8
10 2
3 9
1 3
8 9
10 17
3 9
2 1
6 8
6 1
1 4
5 6
1 8
2 7
3 7
8 3
10 1
10 2
2 8
7 9
8 5
10 4
3 2
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 7 9 10 5 6 8
1 2 3 4 5 6 7 8 9 10
1 2 3 5 8 10 6 9 4 7
1 3 2 4 5 6 7 8 9 10
1 4 5 9 6 3 2 8 7 10
1 3 6 4 7 2 5 9 8 10
1 4 3 5 7 2 10 9 6 8
1 4 10 2 7 9 3 8 5 6