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'You are given a regular N -sided polygon. Label one arbitrary side as side 1 , then label the next sides in clockwise order as side 2 , 3 , ... , N . There are A_i special points on side i . These points are positioned such that side i is divided into A_i + 1 segments with equal length. For instance, suppose that you have a regular 4 -sided polygon, i.e., a square. The following illustration shows how the special points are located within each side when A = [3, 1, 4, 6] . The uppermost side is labelled as side 1 . You want to create as many non-degenerate triangles as possible while satisfying the following requirements. Each triangle consists of 3 distinct special points (not necessarily from different sides) as its corners. Each special point can only become the corner of at most 1 triangle. All triangles must not intersect with each other. Determine the maximum number of non-degenerate triangles that you can create. A triangle is non-degenerate if it has a positive area. The first line consists of an integer N ( 3 <= q N <= q 200 ,000 ). The following line consists of N integers A_i ( 1 <= q A_i <= q 2 cdot 10^9 ). Output a single integer representing the maximum number of non-degenerate triangles that you can create. Explanation for the sample input/output #1 One possible construction which achieves maximum number of non-degenerate triangles can be seen in the following illustration. Explanation for the sample input/output #2 One possible construction which achieves maximum number of non-degenerate triangles can be seen in the following illustration. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
235474575 |
AutumnMist DongFang lAMaLOSER |
M |
Dec. 3, 2023, 6:35 a.m. |
OK |
C# 10 |
TESTS |
56 |
93 |
26009600 |
|
|
235610054 |
NenadDapic |
M |
Dec. 3, 2023, 5:07 p.m. |
OK |
FPC |
TESTS |
56 |
77 |
921600 |
|
|
235514901 |
lunilay2002 |
M |
Dec. 3, 2023, 11:51 a.m. |
OK |
GNU C11 |
TESTS |
56 |
62 |
7987200 |
|
|
235465811 |
StarSilk |
M |
Dec. 3, 2023, 5:01 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
30 |
17612800 |
|
|
235518245 |
liupeilin0821 |
M |
Dec. 3, 2023, 12:19 p.m. |
OK |
GNU C++14 |
TESTS |
56 |
62 |
0 |
|
|
235471369 |
MrPoopybutthole DigiM apakaden |
M |
Dec. 3, 2023, 6:05 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
62 |
0 |
|
|
235465047 |
icypiggy caan_do |
M |
Dec. 3, 2023, 4:51 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
62 |
0 |
|
|
235464834 |
yeminghan |
M |
Dec. 3, 2023, 4:49 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
62 |
0 |
|
|
235656591 |
kuguadawang |
M |
Dec. 4, 2023, 4:53 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
62 |
0 |
|
|
235466308 |
Kevin8502 |
M |
Dec. 3, 2023, 5:08 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
62 |
1638400 |
|
|
235467130 |
xvzhiming |
M |
Dec. 3, 2023, 5:18 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
77 |
819200 |
|
|
235509363 |
Ridu1 |
M |
Dec. 3, 2023, 11:04 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
77 |
1638400 |
|
|
235619594 |
tamminaina_y |
M |
Dec. 3, 2023, 6:18 p.m. |
OK |
GNU C++14 |
TESTS |
56 |
77 |
1638400 |
|
|
235492735 |
codeandlostsanity bkdn23.zguyennhatking |
M |
Dec. 3, 2023, 8:51 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
62 |
0 |
|
|
235478343 |
doccocaubai |
M |
Dec. 3, 2023, 7:07 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
62 |
0 |
|
|
235501936 |
JomnoiZ |
M |
Dec. 3, 2023, 9:59 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
62 |
0 |
|
|
235507756 |
mobarak_hossain_insan |
M |
Dec. 3, 2023, 10:50 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
62 |
819200 |
|
|
235490534 |
bobnuu AzamatRustamov |
M |
Dec. 3, 2023, 8:36 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
62 |
819200 |
|
|
235469348 |
iulianarsenoiu |
M |
Dec. 3, 2023, 5:44 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
62 |
819200 |
|
|
235465349 |
HaoxuanXIE SingleZombie forxen |
M |
Dec. 3, 2023, 4:56 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
62 |
819200 |
|
|
235464336 |
gisp_zjz triple__a Roundgod |
M |
Dec. 3, 2023, 4:43 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
62 |
819200 |
|
|
235650949 |
verywater |
M |
Dec. 4, 2023, 3:16 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
62 |
819200 |
|
|
235500906 |
Rafi02 jjaworska Giselus |
M |
Dec. 3, 2023, 9:50 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
62 |
1638400 |
|
|
235464874 |
ITworker_Z red-stone |
M |
Dec. 3, 2023, 4:49 a.m. |
OK |
GNU C++17 (64) |
TESTS |
56 |
31 |
512000 |
|
|
235465335 |
hohohahahihi Normie28 ilovevoi |
M |
Dec. 3, 2023, 4:55 a.m. |
OK |
GNU C++17 (64) |
TESTS |
56 |
46 |
0 |
|
|
235469959 |
FeathBow |
M |
Dec. 3, 2023, 5:51 a.m. |
OK |
GNU C++17 (64) |
TESTS |
56 |
46 |
0 |
|
|
235464849 |
Karuna arnold518 YeongTree |
M |
Dec. 3, 2023, 4:49 a.m. |
OK |
GNU C++17 (64) |
TESTS |
56 |
46 |
819200 |
|
|
235464494 |
rniya |
M |
Dec. 3, 2023, 4:45 a.m. |
OK |
GNU C++17 (64) |
TESTS |
56 |
46 |
819200 |
|
|
235479689 |
IceKnight1093 |
M |
Dec. 3, 2023, 7:18 a.m. |
OK |
GNU C++17 (64) |
TESTS |
56 |
46 |
819200 |
|
|
235467744 |
maomao90 |
M |
Dec. 3, 2023, 5:25 a.m. |
OK |
GNU C++17 (64) |
TESTS |
56 |
46 |
819200 |
|
|
235616767 |
chappy1 |
M |
Dec. 3, 2023, 5:55 p.m. |
OK |
GNU C++17 (64) |
TESTS |
56 |
46 |
1638400 |
|
|
235495208 |
wrzesinskimikolaj2006 |
M |
Dec. 3, 2023, 9:08 a.m. |
OK |
GNU C++17 (64) |
TESTS |
56 |
46 |
1638400 |
|
|
235480418 |
Hamroz_JONN MmusoM AnriEsoev |
M |
Dec. 3, 2023, 7:24 a.m. |
OK |
GNU C++17 (64) |
TESTS |
56 |
46 |
1638400 |
|
|
235464575 |
CSHwang Sulfox |
M |
Dec. 3, 2023, 4:46 a.m. |
OK |
GNU C++20 (64) |
TESTS |
56 |
15 |
3891200 |
|
|
235465456 |
Akash. |
M |
Dec. 3, 2023, 4:57 a.m. |
OK |
GNU C++20 (64) |
TESTS |
56 |
31 |
0 |
|
|
235467805 |
li_yuang |
M |
Dec. 3, 2023, 5:26 a.m. |
OK |
GNU C++20 (64) |
TESTS |
56 |
31 |
0 |
|
|
235647539 |
mwen |
M |
Dec. 4, 2023, 2:10 a.m. |
OK |
GNU C++20 (64) |
TESTS |
56 |
31 |
0 |
|
|
235464823 |
rohankumarbehera5 Ishaan_23 pbshayar |
M |
Dec. 3, 2023, 4:49 a.m. |
OK |
GNU C++20 (64) |
TESTS |
56 |
31 |
0 |
|
|
235465899 |
who_knows_ Arvi_saleque RifatALmuiN |
M |
Dec. 3, 2023, 5:03 a.m. |
OK |
GNU C++20 (64) |
TESTS |
56 |
31 |
0 |
|
|
235505823 |
antekb natofp kobor |
M |
Dec. 3, 2023, 10:33 a.m. |
OK |
GNU C++20 (64) |
TESTS |
56 |
31 |
819200 |
|
|
235468610 |
eucalyptus |
M |
Dec. 3, 2023, 5:35 a.m. |
OK |
GNU C++20 (64) |
TESTS |
56 |
31 |
1638400 |
|
|
235472575 |
Od_Ali kayumov_muhammad I_am_Mahdi |
M |
Dec. 3, 2023, 6:17 a.m. |
OK |
GNU C++20 (64) |
TESTS |
56 |
31 |
1638400 |
|
|
235470100 |
khanhphucscratch1301 pickle_juice2023 tkdanhk2k10 |
M |
Dec. 3, 2023, 5:52 a.m. |
OK |
GNU C++20 (64) |
TESTS |
56 |
31 |
1638400 |
|
|
235469410 |
ericchen890 michaelsxiang theSSS |
M |
Dec. 3, 2023, 5:45 a.m. |
OK |
Java 11 |
TESTS |
56 |
218 |
4608000 |
|
|
235521719 |
RatanK |
M |
Dec. 3, 2023, 12:49 p.m. |
OK |
Java 21 |
TESTS |
56 |
639 |
2048000 |
|
|
235484988 |
yvbf |
M |
Dec. 3, 2023, 7:56 a.m. |
OK |
Java 8 |
TESTS |
56 |
109 |
0 |
|
|
235503435 |
safarisoul |
M |
Dec. 3, 2023, 10:12 a.m. |
OK |
Java 8 |
TESTS |
56 |
155 |
12697600 |
|
|
235519888 |
arvindf232 |
M |
Dec. 3, 2023, 12:33 p.m. |
OK |
Kotlin 1.6 |
TESTS |
56 |
187 |
409600 |
|
|
235524120 |
VitaliiV |
M |
Dec. 3, 2023, 1:09 p.m. |
OK |
MS C++ 2017 |
TESTS |
56 |
187 |
0 |
|
|
235498113 |
kotprogrammist |
M |
Dec. 3, 2023, 9:29 a.m. |
OK |
MS C++ 2017 |
TESTS |
56 |
202 |
1638400 |
|
|
235476100 |
yonsweng |
M |
Dec. 3, 2023, 6:48 a.m. |
OK |
PyPy 3 |
TESTS |
56 |
280 |
18329600 |
|
|
235530486 |
IceBorworntat |
M |
Dec. 3, 2023, 2:04 p.m. |
OK |
PyPy 3 |
TESTS |
56 |
296 |
18636800 |
|
|
235464749 |
xiaowuc1 |
M |
Dec. 3, 2023, 4:48 a.m. |
OK |
PyPy 3-64 |
TESTS |
56 |
109 |
21196800 |
|
|
235466945 |
Prasanna0028 kevbamboo |
M |
Dec. 3, 2023, 5:15 a.m. |
OK |
PyPy 3-64 |
TESTS |
56 |
109 |
26931200 |
|
|
235469277 |
SriniV Edge_Tree Mustela_Erminea |
M |
Dec. 3, 2023, 5:43 a.m. |
OK |
PyPy 3-64 |
TESTS |
56 |
109 |
27136000 |
|
|
235466061 |
ae12240 LeftPepeper |
M |
Dec. 3, 2023, 5:05 a.m. |
OK |
PyPy 3-64 |
TESTS |
56 |
124 |
21196800 |
|
|
235524255 |
Faiz-ur-Rehman_ |
M |
Dec. 3, 2023, 1:11 p.m. |
OK |
PyPy 3-64 |
TESTS |
56 |
124 |
26931200 |
|
|
235523097 |
subhasravani |
M |
Dec. 3, 2023, 1 p.m. |
OK |
PyPy 3-64 |
TESTS |
56 |
124 |
26931200 |
|
|
235500458 |
Murad634 |
M |
Dec. 3, 2023, 9:47 a.m. |
OK |
PyPy 3-64 |
TESTS |
56 |
124 |
26931200 |
|
|
235479378 |
dmitriy48 |
M |
Dec. 3, 2023, 7:15 a.m. |
OK |
PyPy 3-64 |
TESTS |
56 |
124 |
26931200 |
|
|
235467079 |
xtraglitch Badhrinarayana Cuber2113 |
M |
Dec. 3, 2023, 5:17 a.m. |
OK |
PyPy 3-64 |
TESTS |
56 |
124 |
26931200 |
|
|
235474474 |
toperperperper SamuelLH phillotunru1 |
M |
Dec. 3, 2023, 6:34 a.m. |
OK |
PyPy 3-64 |
TESTS |
56 |
124 |
27033600 |
|
|
235530022 |
sohan507 |
M |
Dec. 3, 2023, 2 p.m. |
OK |
Python 3 |
TESTS |
56 |
124 |
28569600 |
|
|
235557826 |
2110030117 |
M |
Dec. 3, 2023, 3:06 p.m. |
OK |
Python 3 |
TESTS |
56 |
202 |
27136000 |
|
|
235500946 |
vstiff |
M |
Dec. 3, 2023, 9:51 a.m. |
OK |
Rust 2021 |
TESTS |
56 |
31 |
6963200 |
|
|
remove filters
Back to search problems