結果
問題 | No.320 眠れない夜に |
ユーザー |
|
提出日時 | 2015-12-13 01:23:56 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 432 bytes |
コンパイル時間 | 422 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 8,192 KB |
最終ジャッジ日時 | 2024-09-15 10:59:17 |
合計ジャッジ時間 | 2,606 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 31 |
ソースコード
# -*- 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