대충 BOJ 수학1이 대충 하나 남기고 끝났다는 대충글에 대하여
This commit is contained in:
9
zeta_python/completed/1193.py
Normal file
9
zeta_python/completed/1193.py
Normal file
@@ -0,0 +1,9 @@
|
||||
S = lambda n: n*(n+1)//2
|
||||
N = int(input())
|
||||
nor = round((2*N)**.5)
|
||||
t = N - S(nor-1)
|
||||
k = S(nor) - S(nor-1)
|
||||
if nor % 2:
|
||||
print("%d/%d"%(k-t+1, t))
|
||||
else:
|
||||
print("%d/%d"%(t, k-t+1))
|
||||
Reference in New Issue
Block a user