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.
Problems
B"During the final part of fashion show all models come to the stage and stay in one row and fashion designer stays to right to model on the right. During the rehearsal, Izabella noticed, that row isn't nice, but she can't figure out how to fix it. Like many other creative people, Izabella has a specific sense of beauty. Evaluating beauty of row of models Izabella looks at heights of models. She thinks that row is nice if for each model distance to nearest model with less height (model or fashion designer) to the right of her doesn't exceed k (distance between adjacent people equals 1, the distance between people with exactly one man between them equals 2, etc). She wants to make row nice, but fashion designer has his own sense of beauty, so she can at most one time select two models from the row and swap their positions if the left model from this pair is higher than the right model from this pair. Fashion designer (man to the right of rightmost model) has less height than all models and can't be selected for exchange. You should tell if it's possible to make at most one exchange in such a way that row becomes nice for Izabella. In first line there are two integers n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895 xc2 xb7105, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- number of models and required distance. Second line contains n space-separated integers ai (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- height of each model. Pay attention that height of fashion designer is not given and can be less than 1. Print xc2 xabYES xc2 xbb (without quotes) if it's possible to make row nice using at most one exchange, and xc2 xabNO xc2 xbb (without quotes) otherwise. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
32074226 |
Georgia_001 |
F |
Nov. 5, 2017, 11:08 a.m. |
OK |
GNU C++ |
TESTS |
106 |
109 |
11980800 |
|
2800 |
32040869 |
alfredosilalahi693 |
F |
Nov. 4, 2017, 2:48 a.m. |
OK |
GNU C++ |
TESTS |
106 |
109 |
12083200 |
|
2800 |
32086264 |
nullstellensatz |
F |
Nov. 6, 2017, 2:06 a.m. |
OK |
GNU C++ |
TESTS |
106 |
109 |
23142400 |
|
2800 |
32527087 |
vjudge4 |
F |
Nov. 21, 2017, 1:46 p.m. |
OK |
GNU C++ |
TESTS |
106 |
234 |
18124800 |
|
2800 |
32302450 |
ACMLCZH |
F |
Nov. 14, 2017, 3 a.m. |
OK |
GNU C++ |
TESTS |
106 |
249 |
35840000 |
|
2800 |
32301911 |
ACMLCZH |
F |
Nov. 14, 2017, 2:13 a.m. |
OK |
GNU C++ |
TESTS |
106 |
249 |
35840000 |
|
2800 |
32527391 |
vjudge4 |
F |
Nov. 21, 2017, 1:59 p.m. |
OK |
GNU C++ |
TESTS |
106 |
264 |
18124800 |
|
2800 |
32052585 |
ftuknights |
F |
Nov. 4, 2017, 12:19 p.m. |
OK |
GNU C++ |
TESTS |
106 |
1138 |
6144000 |
|
2800 |
32184020 |
yancouto |
F |
Nov. 10, 2017, 1:27 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
46 |
18022400 |
|
2800 |
40979201 |
ReaLNero1 |
F |
July 30, 2018, 4:58 p.m. |
OK |
GNU C++11 |
TESTS |
106 |
62 |
18022400 |
|
2800 |
32071461 |
SandTea |
F |
Nov. 5, 2017, 8:46 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
109 |
6041600 |
|
2800 |
32858470 |
jslijin |
F |
Dec. 2, 2017, 12:57 p.m. |
OK |
GNU C++11 |
TESTS |
106 |
124 |
8089600 |
|
2800 |
32210071 |
xyz.abc |
F |
Nov. 11, 2017, 4:20 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
124 |
9523200 |
|
2800 |
33490465 |
Dreamchaser101 |
F |
Dec. 21, 2017, 8:51 p.m. |
OK |
GNU C++11 |
TESTS |
106 |
124 |
14131200 |
|
2800 |
32235364 |
duxing201606 |
F |
Nov. 12, 2017, 5:46 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
155 |
3993600 |
|
2800 |
32040945 |
lamthao1995 |
F |
Nov. 4, 2017, 2:54 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
156 |
9113600 |
|
2800 |
57872554 |
lopare |
F |
July 28, 2019, 2:54 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
156 |
9216000 |
|
2800 |
57768658 |
py_ultron |
F |
July 25, 2019, 10:32 p.m. |
OK |
GNU C++11 |
TESTS |
106 |
156 |
9216000 |
|
2800 |
32096992 |
Darts501 |
F |
Nov. 6, 2017, 1:32 p.m. |
OK |
GNU C++14 |
TESTS |
106 |
155 |
6246400 |
|
2800 |
33961673 |
agamanan96 |
F |
Jan. 6, 2018, 11:33 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
155 |
7577600 |
|
2800 |
32186007 |
SuperSuck |
F |
Nov. 10, 2017, 5:10 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
156 |
6144000 |
|
2800 |
33961628 |
agamanan96 |
F |
Jan. 6, 2018, 11:29 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
156 |
7577600 |
|
2800 |
33073177 |
zy1997 |
F |
Dec. 10, 2017, 5:53 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
156 |
7577600 |
|
2800 |
32155028 |
SuperSuck |
F |
Nov. 9, 2017, 10:28 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
156 |
12083200 |
|
2800 |
32152421 |
Odom |
F |
Nov. 9, 2017, 7:16 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
156 |
12083200 |
|
2800 |
32081891 |
deep967 |
F |
Nov. 5, 2017, 6:49 p.m. |
OK |
GNU C++14 |
TESTS |
106 |
156 |
12083200 |
|
2800 |
32046742 |
Perfectxx |
F |
Nov. 4, 2017, 8:35 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
156 |
12083200 |
|
2800 |
32040707 |
RoundDog |
F |
Nov. 4, 2017, 2:34 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
156 |
12083200 |
|
2800 |
69521325 |
hjk1030 |
F |
Jan. 25, 2020, 1:31 p.m. |
OK |
GNU C++17 |
TESTS |
106 |
233 |
7987200 |
|
2800 |
41884139 |
des1997 |
F |
Aug. 20, 2018, 2:36 a.m. |
OK |
GNU C++17 |
TESTS |
106 |
1356 |
137420800 |
|
2800 |
32111101 |
vjudge3 |
F |
Nov. 7, 2017, 6:33 a.m. |
OK |
Java 8 |
TESTS |
106 |
1871 |
35123200 |
|
2800 |
32072071 |
Maffka |
F |
Nov. 5, 2017, 9:23 a.m. |
OK |
MS C++ |
TESTS |
106 |
1076 |
29286400 |
|
2800 |
remove filters
Back to search problems