RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
ICPC00015

D. Fibonacci Words

Unrated 레이팅 미적용
난이도
3s
시간 제한
1024MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

The Fibonacci word sequence of bit strings is defined as: \(F\)(\(n\)) =    if \(n = 0\) if \(n = 1\) \(F\)(\(n - 1\)) + \(F\)(\(n - 2\)) if \(n \ge 2\) He\(re + de\)notes concatenation of strings. The first few elements are: \(n\) \(F\)(\(n\)) 101 10110 10110101 1011010110110 101101011011010110101 1011010110110101101011011010110110 1011010110110101101011011010110110101101011011010110101 Given a bit pattern \(p\) and a number \(n\), how often does \(p\) occur in \(F\)(\(n\))?

제약
입력 형식

The first line of each test case contains the integer \(n\) (\(0 \le n \le 100\)). The second line contains the bit pattern \(p\). The pattern \(p\) is nonempty and has a length of at most 100 000 characters.

출력 형식

For each test case, display its case number followed by the number of occurrences of the bit pattern \(p\) in \(F\)(\(n\)). Occurrences may overlap. The number of occurrences will be less than \(2^{63}\).

예제 1
입력
6
10
7
10
6
01
6
101
96
10110101101101
출력
Case 1: 5
Case 2: 8
Case 3: 4
Case 4: 4
Case 5: 7540113804746346428
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC World Finals 2012

평가 및 의견

D. Fibonacci Words

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

D. Fibonacci Words

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8