結果

問題 No.3156 Count That Day's N
ユーザー hato336
提出日時 2025-05-23 20:39:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,272 ms / 3,000 ms
コード長 499 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 82,240 KB
実行使用メモリ 256,344 KB
最終ジャッジ日時 2025-05-23 20:39:32
合計ジャッジ時間 19,643 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
input = sys.stdin.readline

k,n = map(int,input().split())
se = set()
for x in range(1,100000):
    s = x * x * x * x * x * x
    if s > n:break
    for y in range(1,100000):
        t = y * y * y * y
        if s+t <= n:
            se.add(s+t)
        else:
            break
ans = 0
for z in range(1,1000000000000000):
    m = k * z * z
    if m > n:break
    if m in se:
        ans += 1
print(ans)
0