結果

問題 No.1465 Archaea
ユーザー first_vilfirst_vil
提出日時 2021-04-02 23:11:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 297 ms / 2,000 ms
コード長 412 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 19,564 KB
最終ジャッジ日時 2023-08-25 16:20:34
合計ジャッジ時間 2,765 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
7,796 KB
testcase_01 AC 13 ms
7,808 KB
testcase_02 AC 14 ms
7,796 KB
testcase_03 AC 14 ms
7,904 KB
testcase_04 AC 15 ms
7,864 KB
testcase_05 AC 14 ms
7,796 KB
testcase_06 AC 15 ms
7,812 KB
testcase_07 AC 82 ms
9,816 KB
testcase_08 AC 14 ms
7,788 KB
testcase_09 AC 111 ms
9,312 KB
testcase_10 AC 13 ms
7,800 KB
testcase_11 AC 99 ms
10,460 KB
testcase_12 AC 15 ms
8,212 KB
testcase_13 AC 226 ms
16,572 KB
testcase_14 AC 103 ms
8,992 KB
testcase_15 AC 14 ms
7,788 KB
testcase_16 AC 15 ms
7,812 KB
testcase_17 AC 217 ms
10,524 KB
testcase_18 AC 17 ms
8,208 KB
testcase_19 AC 22 ms
9,000 KB
testcase_20 AC 83 ms
9,836 KB
testcase_21 AC 297 ms
19,540 KB
testcase_22 AC 296 ms
19,564 KB
testcase_23 AC 13 ms
7,792 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 0<=MAX[n]::2])
0