結果
| 問題 | No.8130 プラチナバッハ問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-01 21:54:18 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 95 ms / 6,000 ms |
| コード長 | 1,119 bytes |
| 記録 | |
| コンパイル時間 | 167 ms |
| コンパイル使用メモリ | 85,196 KB |
| 実行使用メモリ | 194,640 KB |
| 最終ジャッジ日時 | 2026-04-01 21:54:24 |
| 合計ジャッジ時間 | 2,790 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_1 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| small | 10 % | AC * 12 |
| large | 90 % | AC * 18 |
| 合計 | 2.5 * 100% = 250 点 |
ソースコード
from functools import cache
from bisect import bisect_left, bisect_right
import heapq
from itertools import product
from itertools import permutations
import random
import math
import bisect
import sys
from collections import defaultdict
from itertools import combinations
sys.setrecursionlimit(10**7)
inf = 1 << 60
def sgn(x):
if x > 0:
return 1
elif x == 0:
return 0
else:
return -1
def popC(x):
ans = 0
while x != 0:
ans += x % 2
x //= 2
return ans
def exit():
sys.exit()
def LI():
return list(map(int, input().split()))
def II():
return int(input())
def SI():
return input()
t = int(input())
y = LI()
ans = [True, True]
ps = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41,
43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
dp = [False] * 1061
dp[0] = True
for x in ps:
ndp = [False]*1061
for i in range(1061):
if dp[i]:
ndp[i+x] = True
ndp[i] = True
dp = ndp
for x in range(t):
if y[x] >= 100:
print("Yes")
else:
print("Yes" if dp[y[x]] else "No")