Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat duels/552

Duel #552

A 1v1 battle on the problem «Intersection area».

@sojida_otaqulova · Elo: 1269 (+12) · Pupil
1st place · 2 min 19 s
Tests: 20/20 (100%)
BATTLE OVER Winner: Sojida Otaqulova Solved in 2 min 19 s
Newbie · Elo: 1149 (-12) · @akh1khayrullayev
No attempts
Tests: 0/20 (0%)

Winner: Sojida Otaqulova

The winner was the first to solve it correctly — in 2 min 19 s.

If-42 If Medium 1000 ms 64 MB

Intersection area

Two rectangles with sides parallel to the coordinate axes are given on the plane. The first has its lower-left corner at $(x_{1}; y_{1})$ and upper-right corner at $(x_{2}; y_{2})$; the second at $(x_{3}; y_{3})$ and $(x_{4}; y_{4})$. Find the area of their common part. If there is no common part, or it is only a segment or a point, the area is $0$.

Two overlapping rectangles on the coordinate plane; their common part highlighted

Sample tests

Input #1
0 0 4 3
2 1 6 5
Output #1
4
Input #2
0 0 2 2
3 0 5 2
Output #2
0

Battle results compared

1v1 report
Sojida Otaqulova
@sojida_otaqulova
Winner (1st place)
Asadbek Xayrullayev
@akh1khayrullayev
Not solved
02:19 Solve time —
1 Submissions 0
C++ (GCC 15) Language —
3 ms Run time —

Submission timeline (1)

All submissions
S Sojida Otaqulova +02:19
WIN Accepted
C++ (GCC 15) · 3 ms · 4 MB

Sojida Otaqulova won

The 1v1 battle ended after a hard fight.

S Sojida Otaqulova
Solution: 2 min 19 s
Rating: 1269 (+12)
A Asadbek Xayrullayev
Solution: Not solved
Rating: 1149 (-12)
RIVAL FOUND!

1v1 DUEL IS STARTING

Sojida Otaqulova 1257 Elo
VS 15 minutes
Asadbek Xayrullayev 1148 Elo

Loading the arena...