結果

問題 No.2522 Fall in love, Girls!
ユーザー MasKoaTS
提出日時 2022-01-24 19:27:32
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 387 bytes
コンパイル時間 348 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-25 13:15:36
合計ジャッジ時間 2,263 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 4
other RE * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

n, s = map(int, input().split())

a = [1, 2]
for i in range(n - 2):
	a.append(a[i] + a[i + 1])

cnt = 0
ans = []
f = False
for i in range(n - 1, -1, -1):
	if(f):
		f = False
		continue
	if(a[i] <= s):
		f = True
		ans.append(i + 1)
		cnt += 1
		s -= a[i];
	if(s == 0):
		break
else:
	print("No")
	exit(0)

print("Yes")
print(cnt)
print(*ans[::-1])
0