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

~/algor $ cat duels/556

Duel #556

A 1v1 battle on the problem «Digital root».

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

Winner: Sojida Otaqulova

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

While-36 While Medium 1000 ms 64 MB

Digital root

A positive integer $n$ is given. The sum of its digits is computed; if the result has more than one digit, the sum of its digits is computed, and so on until a one-digit number is obtained. That one-digit number is called the digital root of $n$. Find the digital root and how many times the digit sum was computed (if $n$ itself has one digit, the second number is $0$; for example, $9875 \to 29 \to 11 \to 2$ — the digital root is $2$, the sum was computed $3$ times).

A chain of successive digit sums until one digit remains

Sample tests

Input #1
9875
Output #1
2 3
Input #2
7
Output #2
7 0

Battle results compared

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

Submission timeline (1)

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

Sojida Otaqulova won

The 1v1 battle ended after a hard fight.

A Asadbek Xayrullayev
Solution: Not solved
Rating: 1148 (-12)
S Sojida Otaqulova
Solution: 2 min 51 s
Rating: 1270 (+12)
RIVAL FOUND!

1v1 DUEL IS STARTING

Asadbek Xayrullayev 1160 Elo
VS 15 minutes
Sojida Otaqulova 1257 Elo

Loading the arena...