結果

問題 No.320 眠れない夜に
ユーザー roiti46
提出日時 2015-12-13 01:23:08
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 421 bytes
コンパイル時間 707 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 8,192 KB
最終ジャッジ日時 2024-09-15 10:59:14
合計ジャッジ時間 2,813 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 RE * 1
other AC * 26 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

N, M = map(int, raw_input().split())
miss = [0]*(N + 1)

ans = -1
for i in xrange(3, N + 2):
    a0, a1 = 1, 1
    if i <= N: miss[i] = 1
    for j in xrange(3, N + 1):
        a0, a1 = a1, a1 + a0 - miss[j]
    if a1 < M:
        miss[i] = 0
    elif a1 == M:
        ans = sum(miss[3:])
        break
print ans
0