結果

問題 No.3360 平方根の整数倍の整数部分
コンテスト
ユーザー 回転
提出日時 2025-11-14 22:49:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 705 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 75,744 KB
最終ジャッジ日時 2025-11-14 22:49:14
合計ジャッジ時間 11,963 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = list(map(int,input().split()))

if(N == 1):
    print("NaN")
    exit()

count = 0
now = 1
while(True):
    ng,ok = -1,10**7
    while(ok - ng > 1):
        mid = (ok+ng)//2

        if(now*now <= mid*mid*N):
            ok = mid
        else:
            ng = mid
    count += not (now*now <= ok*ok*N < (now+1)*(now+1))
    if(count == M):
        print(now)
        exit()
    now += 1
0