結果

問題 No.320 眠れない夜に
ユーザー roiti46roiti46
提出日時 2015-12-13 01:23:56
言語 Python2
(2.7.18)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 6,604 KB
実行使用メモリ 7,920 KB
最終ジャッジ日時 2023-10-13 14:11:46
合計ジャッジ時間 2,076 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
7,672 KB
testcase_01 AC 25 ms
7,684 KB
testcase_02 AC 24 ms
7,784 KB
testcase_03 AC 24 ms
7,740 KB
testcase_04 AC 23 ms
7,788 KB
testcase_05 AC 22 ms
7,784 KB
testcase_06 AC 22 ms
7,676 KB
testcase_07 AC 22 ms
7,900 KB
testcase_08 AC 21 ms
7,684 KB
testcase_09 AC 23 ms
7,920 KB
testcase_10 AC 23 ms
7,796 KB
testcase_11 AC 22 ms
7,684 KB
testcase_12 AC 21 ms
7,736 KB
testcase_13 AC 22 ms
7,644 KB
testcase_14 AC 23 ms
7,788 KB
testcase_15 AC 21 ms
7,788 KB
testcase_16 AC 23 ms
7,892 KB
testcase_17 AC 22 ms
7,676 KB
testcase_18 AC 21 ms
7,896 KB
testcase_19 AC 21 ms
7,696 KB
testcase_20 AC 21 ms
7,696 KB
testcase_21 AC 21 ms
7,676 KB
testcase_22 AC 21 ms
7,736 KB
testcase_23 AC 21 ms
7,644 KB
testcase_24 AC 22 ms
7,644 KB
testcase_25 AC 23 ms
7,864 KB
testcase_26 AC 22 ms
7,896 KB
testcase_27 AC 21 ms
7,868 KB
testcase_28 AC 22 ms
7,696 KB
testcase_29 AC 23 ms
7,780 KB
testcase_30 AC 22 ms
7,780 KB
testcase_31 AC 23 ms
7,780 KB
testcase_32 AC 23 ms
7,780 KB
testcase_33 AC 23 ms
7,676 KB
testcase_34 AC 22 ms
7,896 KB
権限があれば一括ダウンロードができます

ソースコード

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 i <= N and a1 < M:
        miss[i] = 0
    elif a1 == M:
        ans = sum(miss[3:])
        break
print ans
0