QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 256 MB مجموع النقاط: 100

#21108. ריצת פרות

الإحصائيات

$N$ הפרות של Farmer John ($1 \leq N \leq 100,000$) שוב מאמנות את פרסותיהן בריצה במסלול אינסופי. מתחילות במיקומים שונים וחלק מהמהירויות שונות.

המסלול מחולק לנתיבים כדי לאפשר עקיפה. שתי פרות באותו נתיב לעולם אינן רשאיות לתפוס אותו מיקום. הוא אינו רוצה שינוי נתיב או מהירות ושואל כמה נתיבים דרושים לריצה של $T$ דקות ($1 \leq T \leq 1,000,000,000$).

קלט

השורה הראשונה מכילה $N$, $T$.

$N$ הבאות מכילות מיקום התחלתי ומהירות של פרה. המיקום שלם אי-שלילי והמהירות חיובית; שניהם לכל היותר מיליארד. המיקומים שונים ונתונים בסדר עולה.

פלט

הדפיסו שלם: מספר הנתיבים המזערי כך ששתי פרות באותו נתיב לעולם לא באותו מיקום, כולל בזמן $T$.

דוגמאות

קלט 1

5 3
0 1
1 2
2 3
3 2
6 1

פלט 1

3

מחבר הבעיה: Mark Gordon, 2014

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:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. 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.