oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

placingtiles Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

problem.txt

Tiles

Wayne has recently just bought a house, and wants to tile the floor. The floor is a 2xn grid, and there are 1x1, 1x2 and 2x2 tiles available. How many ways are there to tile the floor?

Input
The input will contain an integer n

Output
Output the answer mod 10^9+7

Subtasks
subtask 1 (0%): Sample
subtask 2 (5%): n<=1000
subtask 3 (10%): n<=2000000
subtask 4 (85%): n<=10^16

Sample input
2

Sample output
8

Explaination
There are 8 ways
 _ _   _ _   _ _   _ _
|_|_| |_| | | |_| |_ _|
|_|_| |_|_| |_|_| |_|_|
 _ _   _ _   _ _   _ _
|_|_| | | | |_ _| |   |
|_ _| |_|_| |_ _| |_ _|

Tags

Math

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
1011s1024MBMinimum
2551s1024MBMinimum
31051s1024MBMinimum
48551s1024MBMinimum

Judge Compile Command

g++-8 ans.cpp -o placingtiles -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.