結果

問題 No.3156 Count That Day's N
ユーザー dokukuma
提出日時 2025-05-23 19:13:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 313 ms / 3,000 ms
コード長 852 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 82,212 KB
実行使用メモリ 77,952 KB
最終ジャッジ日時 2025-05-23 19:13:20
合計ジャッジ時間 5,166 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random, heapq, math, itertools
from collections import deque, Counter, defaultdict
#from sortedcontainers import SortedSet, SortedList
from bisect import bisect, bisect_left, bisect_right
import heapq as hq
from functools import cache, cmp_to_key
def debug(*x):print('debug:',*x, file=sys.stderr)
sys.setrecursionlimit(300000)
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 61 - 1
mod = 998244353

K,N = mi()
cnt = 0
anslist = set()
for x in range(1,int(10**2.5)+1):
    for y in range(1,10**4):
        n = x**6 + y**4
        if n in anslist: continue
        if N < n: break
        if n % K != 0  : continue
        z = n//K
        if z != math.isqrt(z) * math.isqrt(z): continue
        cnt += 1
        anslist.add(n)
print(cnt)
0