結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,712 KB
testcase_01 AC 14 ms
7,820 KB
testcase_02 AC 15 ms
7,796 KB
testcase_03 AC 13 ms
7,756 KB
testcase_04 WA -
testcase_05 AC 12 ms
7,780 KB
testcase_06 AC 13 ms
7,780 KB
testcase_07 AC 94 ms
9,876 KB
testcase_08 WA -
testcase_09 AC 140 ms
9,268 KB
testcase_10 AC 14 ms
7,788 KB
testcase_11 AC 115 ms
10,384 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 117 ms
9,028 KB
testcase_15 AC 15 ms
7,800 KB
testcase_16 AC 17 ms
8,216 KB
testcase_17 AC 265 ms
10,604 KB
testcase_18 AC 26 ms
8,240 KB
testcase_19 AC 93 ms
9,008 KB
testcase_20 AC 163 ms
9,736 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 14 ms
7,848 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 i*2<=n:
    if MIN[i]!=INF:
      MIN[i*2]=min(MIN[i*2],max(MIN[i]-1,0))
    if MAX[i]!=0 and MAX[i]!=-INF:
      MAX[i*2]=max(MAX[i*2],MAX[i]-1)
  if i+3<=n:
    if MIN[i]!=INF:
      MIN[i+3]=min(MIN[i+3],max(MIN[i]-1,0))
    if MAX[i]!=0 and MAX[i]!=-INF:
      MAX[i+3]=max(MAX[i+3],MAX[i]-1)
print('YNEOS'[not (MIN[n]<=0<=MAX[n])::2])
0