109312024-04-20 10:01:2842Sakktábla (75 pont)python3Accepted 75/7517ms13100 KiB
from sys import stdin
input=stdin.readline

def solv():
    N,M=[int(x) for x in input().split()]
    if N>M:
        N,M=M,N
    K=max(1,int((2*N)**0.5)-1)
    while N>=(K+1)**2//2 and M>=((K+1)**2+1)//2:
        K+=1
    return K

print(solv())
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/017ms11176 KiB
2Accepted0/017ms11656 KiB
3Accepted5/517ms11716 KiB
4Accepted5/517ms12020 KiB
5Accepted5/517ms12184 KiB
6Accepted5/517ms12104 KiB
7Accepted5/517ms12468 KiB
8Accepted5/517ms12548 KiB
9Accepted5/517ms12332 KiB
10Accepted5/517ms12776 KiB
11Accepted7/717ms12680 KiB
12Accepted7/717ms12740 KiB
13Accepted7/717ms13100 KiB
14Accepted7/717ms13040 KiB
15Accepted7/717ms13092 KiB