結果
問題 | No.1318 ABCD quadruplets |
ユーザー | ayaoni |
提出日時 | 2020-12-16 03:07:08 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,148 ms / 2,000 ms |
コード長 | 1,655 bytes |
コンパイル時間 | 253 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 84,352 KB |
最終ジャッジ日時 | 2024-09-20 04:25:11 |
合計ジャッジ時間 | 11,014 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
import sys sys.setrecursionlimit(10**7) def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) N,M = MI() ANS = [0]*(N+1) for a in range(M+1): x = a**2 if x+9*a**2 > N: break for b in range(a,M+1): y = x+b*(a+b) if y+2*a*b+5*b**2 > N: break for c in range(b,M+1): z = y+c*(a+b+c) if z+(a+b)*c+2*c**2 > N: break for d in range(c,M+1): w = z+d*(a+b+c+d) if w > N: break if a == b: if b == c: if c == d: ANS[w] += 1 else: ANS[w] += 4 else: if c == d: ANS[w] += 6 else: ANS[w] += 12 else: if b == c: if c == d: ANS[w] += 4 else: ANS[w] += 12 else: if c == d: ANS[w] += 12 else: ANS[w] += 24 print(*ANS,sep='\n')