Please sign in first.
Submission #74600178
Source Code Expand
def check(H:list,W:list):
if any(i<3 for i in H) or any(i<3 for i in W) or sum(H) != sum(W):
return 0
if min(*H,*W) in W:
C = W.copy()
W = H.copy()
H = C
s = sum(H)
mh,Ha,Hb = sorted(H)
ans = 0
for mh1 in range(1,mh-1):
for mh2 in range(1,mh-mh1):
mh3 = mh-mh1-mh2
if mh3<=0:
break
w1,w2,w3 = sorted([W[0]-mh1,W[1]-mh2,W[2]-mh3])
for mw in range(1,w1-1):
ans += min(Ha-mw,Hb-w1+mw,w2,w3) -1
return ans
n = int(input())
if n>=212:
i = 8
elif n>=126:
i = 6
else:
i = 4
print(i)
Submission Info
| Submission Time | |
|---|---|
| Task | A - New Generation ABC |
| User | hpylori |
| Language | Python (CPython 3.13.7) |
| Score | 100 |
| Code Size | 668 Byte |
| Status | AC |
| Exec Time | 10 ms |
| Memory | 9448 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, test_0.txt, test_1.txt, test_2.txt, test_3.txt, test_4.txt, test_5.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example_00.txt | AC | 9 ms | 9380 KiB |
| example_01.txt | AC | 10 ms | 9252 KiB |
| example_02.txt | AC | 10 ms | 9228 KiB |
| test_0.txt | AC | 10 ms | 9448 KiB |
| test_1.txt | AC | 10 ms | 9372 KiB |
| test_2.txt | AC | 10 ms | 9168 KiB |
| test_3.txt | AC | 10 ms | 9168 KiB |
| test_4.txt | AC | 10 ms | 9380 KiB |
| test_5.txt | AC | 10 ms | 9448 KiB |