結果

問題 No.1465 Archaea
ユーザー first_vilfirst_vil
提出日時 2021-04-02 23:10:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 10,888 KB
実行使用メモリ 19,704 KB
最終ジャッジ日時 2023-08-25 13:33:31
合計ジャッジ時間 2,895 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,800 KB
testcase_01 AC 15 ms
7,880 KB
testcase_02 AC 15 ms
7,860 KB
testcase_03 AC 14 ms
7,856 KB
testcase_04 WA -
testcase_05 AC 15 ms
7,788 KB
testcase_06 AC 13 ms
7,848 KB
testcase_07 AC 79 ms
9,832 KB
testcase_08 WA -
testcase_09 AC 116 ms
9,304 KB
testcase_10 AC 15 ms
7,836 KB
testcase_11 AC 97 ms
10,316 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 106 ms
9,036 KB
testcase_15 AC 15 ms
7,976 KB
testcase_16 AC 14 ms
7,908 KB
testcase_17 AC 211 ms
10,648 KB
testcase_18 AC 16 ms
8,248 KB
testcase_19 AC 22 ms
9,020 KB
testcase_20 AC 80 ms
9,848 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 13 ms
7,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
INF=int(1e9)
MIN=[INF]*(n+1)
MAX=[-INF]*(n+1)
MIN[1]=MAX[1]=k
for i in range(1,n):
  if MIN[i]==INF or MAX[i]==0:
    continue
  if i*2<=n:
    MIN[i*2]=min(MIN[i*2],max(MIN[i]-1,0))
    if MAX[i]!=0:
      MAX[i*2]=max(MAX[i*2],MAX[i]-1)
  if i+3<=n:
    MIN[i+3]=min(MIN[i+3],max(MIN[i]-1,0))
    if MAX[i]!=0:
      MAX[i+3]=max(MAX[i+3],MAX[i]-1)
print('YNEOS'[not (MIN[n]<=0<=MAX[n])::2])
0