結果

問題 No.320 眠れない夜に
ユーザー roiti46roiti46
提出日時 2015-12-13 01:23:08
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 421 bytes
コンパイル時間 527 ms
コンパイル使用メモリ 6,700 KB
実行使用メモリ 7,960 KB
最終ジャッジ日時 2023-10-13 14:11:43
合計ジャッジ時間 3,038 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
7,892 KB
testcase_01 AC 24 ms
7,776 KB
testcase_02 AC 23 ms
7,888 KB
testcase_03 AC 23 ms
7,860 KB
testcase_04 RE -
testcase_05 AC 22 ms
7,900 KB
testcase_06 AC 23 ms
7,756 KB
testcase_07 AC 23 ms
7,868 KB
testcase_08 AC 23 ms
7,872 KB
testcase_09 AC 23 ms
7,756 KB
testcase_10 AC 23 ms
7,688 KB
testcase_11 AC 22 ms
7,900 KB
testcase_12 AC 23 ms
7,772 KB
testcase_13 AC 24 ms
7,760 KB
testcase_14 AC 23 ms
7,780 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 22 ms
7,776 KB
testcase_19 AC 21 ms
7,888 KB
testcase_20 AC 22 ms
7,772 KB
testcase_21 AC 21 ms
7,704 KB
testcase_22 AC 21 ms
7,760 KB
testcase_23 AC 22 ms
7,732 KB
testcase_24 AC 22 ms
7,644 KB
testcase_25 AC 21 ms
7,692 KB
testcase_26 AC 20 ms
7,904 KB
testcase_27 AC 21 ms
7,812 KB
testcase_28 AC 21 ms
7,732 KB
testcase_29 AC 21 ms
7,692 KB
testcase_30 RE -
testcase_31 AC 21 ms
7,736 KB
testcase_32 AC 20 ms
7,868 KB
testcase_33 AC 22 ms
7,640 KB
testcase_34 RE -
権限があれば一括ダウンロードができます

ソースコード

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