#2274. 岁月
岁月
岁月
题目描述
岁月 - Problem - QOJ.ac
QOJ.ac
QOJ
[QOJ](//qoj.ac)
Time Limit: 3 s
Memory Limit: 512 MB
Total points: 100
2025 二十六省联合省队选拔 Day 2
B.
岁月
[
Statistics ](/contest/1930/problem/10151/statistics)
[
Statement ](#tab-statement)
[ Languages](#)
[Default](/contest/1930/problem/10151/statement/default)
[English](/contest/1930/problem/10151/statement/en)
**This problem is prepared by
Itst .**
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/1930/problem/10151?locale=ar)
[English](//qoj.ac/contest/1930/problem/10151?locale=en)
[Español](//qoj.ac/contest/1930/problem/10151?locale=es)
[Français](//qoj.ac/contest/1930/problem/10151?locale=fr)
[日本語](//qoj.ac/contest/1930/problem/10151?locale=ja)
[한국어](//qoj.ac/contest/1930/problem/10151?locale=ko)
[Türkçe](//qoj.ac/contest/1930/problem/10151?locale=tr)
[简体中文](//qoj.ac/contest/1930/problem/10151?locale=zh-cn)
[繁體中文](//qoj.ac/contest/1930/problem/10151?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:22 (UTC+8)
输入格式
(见题面原文)
输出格式
(见题面原文)
数据范围
(见题面原文)
样例
样例 1
0 2
2 1
1 2 1
3 3
1 2 2
1 3 2
2 3 2
750000006
171875002
样例 2
0 5
5 6
1 3 2
2 5 1
1 5 2
1 2 1
2 4 1
3 4 2
4 6
1 4 4
1 3 6
2 4 1
2 3 5
1 2 2
3 4 3
9 27
4 9 1
1 3 1
4 6 1
4 8 1
7 8 1
2 4 1
3 6 1
7 9 1
1 8 1
5 7 1
1 5 1
1 9 1
2 7 1
3 8 1
3 5 1
1 7 1
5 8 1
3 4 1
2 8 1
3 9 1
2 3 1
1 6 1
3 7 1
6 7 1
8 9 1
4 7 1
1 2 1
12 45
5 12 1
6 12 1
9 11 1
3 6 1
1 8 1
4 5 1
4 11 1
7 10 1
3 4 1
1 4 1
1 2 1
2 10 1
6 9 1
2 7 1
3 9 1
4 12 1
7 11 1
1 12 1
9 12 1
5 8 1
2 6 1
2 12 1
7 9 1
3 7 1
1 7 1
5 6 1
6 10 1
1 10 1
2 5 1
8 12 1
4 8 1
2 9 1
8 9 1
9 10 1
1 9 1
1 6 1
1 11 1
3 10 1
7 8 1
5 11 1
5 10 1
3 11 1
8 11 1
2 8 1
6 7 1
14 55
2 6 1
4 10 1
5 9 1
2 14 1
1 3 1
3 5 1
5 14 1
2 10 1
7 8 1
4 12 1
2 11 1
10 14 1
3 11 1
4 13 1
11 14 1
5 7 1
5 6 1
8 10 1
1 14 1
2 4 1
9 11 1
6 13 1
3 9 1
10 11 1
4 11 1
4 14 1
12 14 1
1 11 1
1 12 1
2 3 1
5 11 1
1 8 1
2 5 1
11 13 1
1 6 1
10 12 1
4 5 1
1 5 1
7 9 1
6 8 1
4 7 1
6 10 1
6 14 1
8 9 1
5 10 1
6 11 1
4 6 1
1 9 1
7 10 1
1 10 1
13 14 1
8 11 1
6 9 1
7 11 1
1 13 1
248046877
812500006
549530817
326916896
302539058