QOJ.ac

QOJ

Limite de temps : 2 s Limite de mémoire : 1024 MB

#23989. קארוטה

Statistiques

תיאור הבעיה

מתקיים טורניר קארוטה בשיטת ליגה (כולם נגד כולם) שבו משתתפים $N$ תלמידים.

בטורניר זה, בכל משחק משתתפים $2$ תלמידים, וכל זוג של $2$ תלמידים שונים מתמודד זה מול זה במשחק $1$ בדיוק.

מצאו את המספר הכולל של המשחקים המתקיימים בטורניר כולו.

מגבלות

  • $2 \le N \le 100$.
  • $N$ הוא מספר שלם.

קלט

הקלט ניתן בפורמט הבא:

N

פלט

הדפיסו את המספר הכולל של המשחקים המתקיימים בטורניר כולו.

אל תדפיסו דבר מלבד התשובה. (למשל, אל תדפיסו טקסט המבקש להזין קלט.)

לגבי פורמט התשובה, ניתן להיעזר בבעיות התרגול ודוגמאות הפתרון שלהן.

דוגמה 1

קלט

3

פלט

3

נסמן את $3$ המשתתפים ב-A, B ו-C. במקרה זה, המשחקים המתקיימים בטורניר כולו הם $3$ המשחקים הבאים:

  • A נגד B
  • A נגד C
  • B נגד C

דוגמה 2

קלט

4

פלט

6

נסמן את $4$ המשתתפים ב-A, B, C ו-D. במקרה זה, המשחקים המתקיימים בטורניר כולו הם $6$ המשחקים הבאים:

  • A נגד B
  • A נגד C
  • A נגד D
  • B נגד C
  • B נגד D
  • C נגד D

דוגמה 3

קלט

2

פלט

1

דוגמה 4

קלט

100

פלט

4950

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.