Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat duels/861

Duel #861

A 1v1 battle on the problem «Diagonals of a polygon».

@latifovodilbek56 · Elo: 1192 (-8) · Newbie
No attempts
Tests: 0/20 (0%)
BATTLE OVER Winner: Iqbolshoh Ilhomjonov Solved in 41 s
@iqbolshoh · Pupil · Elo: 1387 (+8)
1st place · 41 s
Tests: 20/20 (100%)

Winner: Iqbolshoh Ilhomjonov

The winner was the first to solve it correctly — in 41 s.

Begin-13 Begin Easy 1000 ms 64 MB

Diagonals of a polygon

The number of vertices of a convex polygon is given. Find the number of its diagonals . A diagonal is a segment joining two non-adjacent vertices:

A convex hexagon: n vertices, diagonals drawn from each vertex to the non-adjacent ones

Sample tests

Input #1
5
Output #1
5
Input #2
4
Output #2
2

Battle results compared

1v1 report
Odilbek Latifov
@latifovodilbek56
Not solved
Iqbolshoh Ilhomjonov
@iqbolshoh
Winner (1st place)
— Solve time 00:41
0 Submissions 2
— Language C++ (GCC 15)
— Run time 5 ms

Submission timeline (2)

All submissions
C++ (GCC 15) · 5 ms · 4 MB
Compilation error
C++ (GCC 15)

Iqbolshoh Ilhomjonov won

The 1v1 battle ended after a hard fight.

O Odilbek Latifov
Solution: Not solved
Rating: 1192 (-8)
I Iqbolshoh Ilhomjonov
Solution: 41 s
Rating: 1387 (+8)
Start a new duel