結果

問題 No.3360 平方根の整数倍の整数部分
コンテスト
ユーザー titia
提出日時 2025-12-03 01:43:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 454 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 325 ms
コンパイル使用メモリ 82,284 KB
実行使用メモリ 138,920 KB
最終ジャッジ日時 2025-12-03 01:43:09
合計ジャッジ時間 5,597 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline

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

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

LIST=[0]*(10**7)
LIST[0]=1

now=0

for i in range(1,5*10**6+1):

    while True:
        if (now+1)*(now+1)<=N*i*i:
            now+=1
        else:
            break

    if now<10**7:
        LIST[now]=1
    else:
        break

count=0
for i in range(10**7):
    if LIST[i]==0:
        count+=1

    if count==M:
        print(i)
        break
0