Universal Cup Judging System

Universal Cup

Limite de temps : 12.0 s Limite de mémoire : 1024 MB Points totaux : 100 Hackable ✓
Statistiques

الوصف

انتهت عطلة رأس السنة، وتعود شركة المقاولات الخاصة بك إلى العمل. لسوء الحظ، لا يزال بعض الموظفين يحتفلون...

اليوم، حضر للعمل لديك $a$ من العمال الصاحين و $b$ من العمال المخمورين. سيكون كل عامل متاحاً طوال اليوم. كما تلقت شركتك $m$ من الطلبات لهذا اليوم. يُحدَّد كل طلب ببداية ونهاية الفترة الزمنية اللازمة لتنفيذه: $[st, fn]$. يتطلب مثل هذا الطلب عاملاً واحداً للعمل عليه من اللحظة $st$ إلى اللحظة $fn$ ضمناً. يمكن للعامل الواحد إنجاز عدة طلبات إذا كانت فتراتها الزمنية غير متقاطعة. بالإضافة إلى ذلك، ينتمي كل طلب إلى أحد نوعين: الطلب البسيط يمكن أن ينجزه أي عامل، بينما يتطلب الطلب المعقد عاملاً صاحياً.

هل ستتمكن شركتك من التعامل مع طلبات اليوم؟

الإدخال

يحتوي السطر الأول على عدد صحيح $t$، وهو عدد حالات الاختبار ($1 \le t \le 2000$). لكل حالة اختبار:

يحتوي السطر الأول على ثلاثة أعداد صحيحة: $a$ و $b$ و $m$ ($0 \le a, b, m \le 10\,000$).

ثم تليها $m$ من الأسطر. يحتوي كل سطر على ثلاثة أعداد صحيحة $type$ و $st$ و $fn$، تصف طلباً بسيطاً (إذا كان $type = 1$) أو معقداً ($type = 2$) بفترة زمنية $[st, fn]$ ($type \in \{1, 2\}$؛ $1 \le st \le fn \le 2 \cdot m$). على سبيل المثال، يصف السطر 1 2 4 طلباً بسيطاً يتطلب ثلاث لحظات، من اللحظة الثانية إلى الرابعة، شاملاً الطرفين.

مجموع قيم $m$ عبر جميع حالات الاختبار لا يتجاوز $10\,000$.

الإخراج

لكل حالة اختبار، اطبع سطراً واحداً يحتوي على الإجابة: "Yes" أو "No" (غير حساس لحالة الأحرف).

مثال

1
1 1 2
1 1 2
2 2 4
Yes

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#1224EditorialOpen题解jianglyView

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.