結果
| 問題 | No.3787 17 years old |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-11-06 21:23:50 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 103 ms / 2,000 ms |
| + 9µs | |
| コード長 | 1,335 bytes |
| 記録 | |
| コンパイル時間 | 84 ms |
| コンパイル使用メモリ | 64,464 KB |
| 実行使用メモリ | 61,416 KB |
| 最終ジャッジ日時 | 2026-11-06 21:23:53 |
| 合計ジャッジ時間 | 2,092 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 3 |
ソースコード
import sys
sys.setrecursionlimit(2*10**7)
#↓codon===============================
import string
Alp_low=list(string.ascii_lowercase)
Alp_up=list(string.ascii_uppercase)
Digit="0123456789"
dij=[[0,1],[1,0],[0,-1],[-1,0]]
def nin():
"""
library
https://github.com/not522/ac-library-python
https://github.com/cheran-senthil/PyRival
https://github.com/kurao2924/Kurao_Py_Library
https://github.com/navel-tos/cp-library-for-codon
"""
return list(map(int,input().split()))
def deq(x):
return [i-1 for i in x]
mod=998244353
_factorial=[1]
def factorial(n):
while len(_factorial)<=n:
_factorial.append((_factorial[-1]*len(_factorial))%mod)
return _factorial[n]
_inv_factorial=[1]
def inv_factorial(n):
while len(_inv_factorial)<=n:
_inv_factorial.append((_inv_factorial[-1]*pow(len(_inv_factorial),mod-2,mod))%mod)
return _inv_factorial[n]
def binom(n,r):
if r>=mod:
raise ValueError("r is too big")
if n<0:
return 0
if r>n:
return 0
if r<0:
return 0
ans=((factorial(n)*inv_factorial(r))%mod*inv_factorial(n-r))%mod
return ans
mod=998244353
def main():
t,=nin()
for _ in range(t):
n,=nin()
if n in [1,2,4,8,16]:
print("Yes")
else:
print("No")
if __name__=="__main__":
main()