Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
| 733
|
Codeforces Round 378 (Div. 2) |
FINISHED |
False |
9000 |
298482923 |
Oct. 31, 2016, 2:05 p.m. |
Problems
The academic year has just begun, but lessons and olympiads have already occupied all the free time. It is not a surprise that today Olga fell asleep on the Literature. She had a dream in which she was on a stairs. The stairs consists of n steps. The steps are numbered from bottom to top, it means that the lowest step has number 1 , and the highest step has number n . Above each of them there is a pointer with the direction (up or down) Olga should move from this step. As soon as Olga goes to the next step, the direction of the pointer (above the step she leaves) changes. It means that the direction "up" changes to "down", the direction "down" — to the direction "up". Olga always moves to the next step in the direction which is shown on the pointer above the step. If Olga moves beyond the stairs, she will fall and wake up. Moving beyond the stairs is a moving down from the first step or moving up from the last one (it means the n -th) step. In one second Olga moves one step up or down according to the direction of the pointer which is located above the step on which Olga had been at the beginning of the second. For each step find the duration of the dream if Olga was at this step at the beginning of the dream. Olga's fall also takes one second, so if she was on the first step and went down, she would wake up in the next second. The first line contains single integer n ( 1 ≤ n ≤ 10 6 ) — the number of steps on the stairs. The second line contains a string s with the length n — it denotes the initial direction of pointers on the stairs. The i -th character of string s denotes the direction of the pointer above i -th step, and is either ' U ' (it means that this pointer is directed up), or ' D ' (it means this pointed is directed down). The pointers are given in order from bottom to top. Print n numbers, the i -th of which is equal either to the duration of Olga's dream or to - 1 if Olga never goes beyond the stairs, if in the beginning of sleep she was on th |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
22205505 |
jkxjkx1031 |
E |
Nov. 14, 2016, 10:14 a.m. |
OK |
GNU C |
TESTS |
86 |
607 |
64102400 |
|
2500 |
|
39736584 |
vjudge5 |
E |
June 28, 2018, 8:15 a.m. |
OK |
GNU C++ |
TESTS |
86 |
358 |
13004800 |
|
2500 |
|
22034737 |
liziy |
E |
Nov. 4, 2016, 1:02 p.m. |
OK |
GNU C++ |
TESTS |
86 |
374 |
13824000 |
|
2500 |
|
22034415 |
zbh2047 |
E |
Nov. 4, 2016, 12:47 p.m. |
OK |
GNU C++ |
TESTS |
86 |
374 |
13824000 |
|
2500 |
|
22602334 |
vjudge2 |
E |
Nov. 29, 2016, 3:40 p.m. |
OK |
GNU C++ |
TESTS |
86 |
374 |
32768000 |
|
2500 |
|
29773232 |
Septher |
E |
Aug. 25, 2017, 8:12 a.m. |
OK |
GNU C++ |
TESTS |
86 |
374 |
57856000 |
|
2500 |
|
22222917 |
vietthangcvp |
E |
Nov. 15, 2016, 1:14 p.m. |
OK |
GNU C++ |
TESTS |
86 |
389 |
25088000 |
|
2500 |
|
23533332 |
orbitingflea |
E |
Jan. 4, 2017, 10:36 a.m. |
OK |
GNU C++ |
TESTS |
86 |
389 |
26931200 |
|
2500 |
|
22037472 |
njzwj2007 |
E |
Nov. 4, 2016, 3:26 p.m. |
OK |
GNU C++ |
TESTS |
86 |
389 |
29081600 |
|
2500 |
|
24428928 |
vjudge2 |
E |
Feb. 4, 2017, 9:34 a.m. |
OK |
GNU C++ |
TESTS |
86 |
389 |
35123200 |
|
2500 |
|
22782009 |
Ringo |
E |
Dec. 7, 2016, 9:54 a.m. |
OK |
GNU C++ |
TESTS |
86 |
389 |
35123200 |
|
2500 |
|
53030785 |
time_interspace |
E |
April 19, 2019, 11:40 p.m. |
OK |
GNU C++11 |
TESTS |
86 |
218 |
25088000 |
|
2500 |
|
52817710 |
luogu_bot3 |
E |
April 16, 2019, 10:24 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
312 |
25907200 |
|
2500 |
|
57878233 |
lopare |
E |
July 28, 2019, 6:33 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
327 |
819200 |
|
2500 |
|
48374342 |
StartAgain |
E |
Jan. 14, 2019, 6:44 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
327 |
5222400 |
|
2500 |
|
53534854 |
shaojianan |
E |
April 30, 2019, 1:01 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
327 |
25088000 |
|
2500 |
|
51360699 |
LBRhhhh |
E |
March 16, 2019, 7:05 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
327 |
49152000 |
|
2500 |
|
57813635 |
py_ultron |
E |
July 26, 2019, 6:35 p.m. |
OK |
GNU C++11 |
TESTS |
86 |
342 |
819200 |
|
2500 |
|
45139931 |
vjudge2 |
E |
Oct. 31, 2018, 2:02 p.m. |
OK |
GNU C++11 |
TESTS |
86 |
342 |
41062400 |
|
2500 |
|
51365043 |
vjudge3 |
E |
March 16, 2019, 9:10 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
343 |
49152000 |
|
2500 |
|
33610408 |
Dreamchaser101 |
E |
Dec. 25, 2017, 7:05 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
358 |
25497600 |
|
2500 |
|
44843596 |
3015218054 |
E |
Oct. 25, 2018, 1:40 p.m. |
OK |
GNU C++14 |
TESTS |
86 |
311 |
25088000 |
|
2500 |
|
45140581 |
w446506278 |
E |
Oct. 31, 2018, 2:20 p.m. |
OK |
GNU C++14 |
TESTS |
86 |
311 |
41062400 |
|
2500 |
|
23363592 |
Ali.Pi |
E |
Dec. 27, 2016, 5 p.m. |
OK |
GNU C++14 |
TESTS |
86 |
312 |
10956800 |
|
2500 |
|
27441326 |
mjguru |
E |
May 30, 2017, 6:39 a.m. |
OK |
GNU C++14 |
TESTS |
86 |
327 |
1024000 |
|
2500 |
|
36797474 |
NotNight |
E |
April 1, 2018, 12:13 p.m. |
OK |
GNU C++14 |
TESTS |
86 |
327 |
12390400 |
|
2500 |
|
27199591 |
vjudge2 |
E |
May 18, 2017, 3:21 p.m. |
OK |
GNU C++14 |
TESTS |
86 |
327 |
23347200 |
|
2500 |
|
26450436 |
MasterMind0108 |
E |
April 17, 2017, 9:24 a.m. |
OK |
GNU C++14 |
TESTS |
86 |
327 |
26931200 |
|
2500 |
|
68832632 |
tbzard |
E |
Jan. 15, 2020, 12:07 a.m. |
OK |
GNU C++14 |
TESTS |
86 |
327 |
33792000 |
|
2500 |
|
26123376 |
alan23273850 |
E |
April 4, 2017, 1:40 p.m. |
OK |
GNU C++14 |
TESTS |
86 |
342 |
2867200 |
|
2500 |
|
22300304 |
SssssssssssssbbbBBBB |
E |
Nov. 18, 2016, 5:29 a.m. |
OK |
GNU C++14 |
TESTS |
86 |
342 |
41062400 |
|
2500 |
|
59116720 |
Luv_letter |
E |
Aug. 20, 2019, 2:11 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
311 |
1024000 |
|
2500 |
|
35517359 |
yls1170568156 |
E |
Feb. 20, 2018, 9:50 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
327 |
25292800 |
|
2500 |
|
59517726 |
vjudge5 |
E |
Aug. 26, 2019, 10:45 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
327 |
49049600 |
|
2500 |
|
43552621 |
int.elligence |
E |
Sept. 29, 2018, 2:42 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
373 |
32972800 |
|
2500 |
|
62604974 |
k24 |
E |
Oct. 15, 2019, 7:22 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
374 |
2048000 |
|
2500 |
|
56885652 |
BinGoo0o0o |
E |
July 12, 2019, 12:27 p.m. |
OK |
GNU C++17 |
TESTS |
86 |
374 |
33075200 |
|
2500 |
|
59118061 |
Luv_letter |
E |
Aug. 20, 2019, 3:02 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
467 |
2969600 |
|
2500 |
|
50667329 |
vjudge4 |
E |
March 2, 2019, 5:06 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
468 |
21094400 |
|
2500 |
|
52004957 |
vjudge4 |
E |
March 30, 2019, 7:56 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
483 |
21094400 |
|
2500 |
|
51448419 |
chinmay0906 |
E |
March 18, 2019, 1:34 p.m. |
OK |
GNU C++17 |
TESTS |
86 |
483 |
34201600 |
|
2500 |
|
22152607 |
intsashka |
E |
Nov. 10, 2016, 5:18 p.m. |
OK |
Java 8 |
TESTS |
86 |
420 |
30822400 |
|
2500 |
|
22077613 |
intsashka |
E |
Nov. 6, 2016, 3:05 p.m. |
OK |
Java 8 |
TESTS |
86 |
421 |
30822400 |
|
2500 |
|
22161009 |
donli |
E |
Nov. 11, 2016, 10:29 a.m. |
OK |
Java 8 |
TESTS |
86 |
436 |
17510400 |
|
2500 |
|
22503966 |
JialinOuyang |
E |
Nov. 26, 2016, 8:29 a.m. |
OK |
Java 8 |
TESTS |
86 |
452 |
7782400 |
|
2500 |
|
22182194 |
intsashka |
E |
Nov. 12, 2016, 5:15 p.m. |
OK |
Java 8 |
TESTS |
86 |
452 |
30822400 |
|
2500 |
|
22115412 |
ajax145 |
E |
Nov. 8, 2016, 3:22 p.m. |
OK |
Java 8 |
TESTS |
86 |
514 |
46489600 |
|
2500 |
|
22034546 |
kenkoooo |
E |
Nov. 4, 2016, 12:53 p.m. |
OK |
Java 8 |
TESTS |
86 |
530 |
26521600 |
|
2500 |
|
44919970 |
guptautkarsh028 |
E |
Oct. 26, 2018, 5:23 p.m. |
OK |
Java 8 |
TESTS |
86 |
561 |
53657600 |
|
2500 |
|
52013435 |
vjudge5 |
E |
March 30, 2019, 9:32 a.m. |
OK |
MS C++ |
TESTS |
86 |
623 |
13004800 |
|
2500 |
|
22723599 |
JC_Kiraa |
E |
Dec. 6, 2016, 5:49 a.m. |
OK |
MS C++ |
TESTS |
86 |
717 |
41062400 |
|
2500 |
|
22102170 |
Dmit_riy |
E |
Nov. 7, 2016, 9:04 p.m. |
OK |
MS C++ |
TESTS |
86 |
795 |
1024000 |
|
2500 |
|
22169706 |
UclaWorstUniversity |
E |
Nov. 11, 2016, 9:23 p.m. |
OK |
MS C++ |
TESTS |
86 |
857 |
46387200 |
|
2500 |
|
22073335 |
polka125 |
E |
Nov. 6, 2016, 11:13 a.m. |
OK |
MS C++ |
TESTS |
86 |
888 |
17510400 |
|
2500 |
|
22102419 |
Mosyagin |
E |
Nov. 7, 2016, 9:30 p.m. |
OK |
MS C++ |
TESTS |
86 |
919 |
34099200 |
|
2500 |
|
38709674 |
Ali_Pi |
E |
May 29, 2018, 5:20 a.m. |
OK |
Python 2 |
TESTS |
86 |
1309 |
107622400 |
|
2500 |
|
22321400 |
Yut0 |
E |
Nov. 19, 2016, 8:32 a.m. |
OK |
Python 3 |
TESTS |
86 |
1637 |
118067200 |
|
2500 |
|
22482921 |
belovedeagle |
E |
Nov. 25, 2016, 5:59 a.m. |
OK |
Rust |
TESTS |
86 |
389 |
43008000 |
|
2500 |
remove filters
Back to search problems