CF70A.Cookies

普及-

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Fangy collects cookies. Once he decided to take a box and put cookies into it in some way. If we take a square k × k in size, divided into blocks 1 × 1 in size and paint there the main diagonal together with cells, which lie above it, then the painted area will be equal to the area occupied by one cookie k in size. Fangy also has a box with a square base 2_n_ × 2_n_, divided into blocks 1 × 1 in size. In a box the cookies should not overlap, and they should not be turned over or rotated. See cookies of sizes 2 and 4 respectively on the figure:

To stack the cookies the little walrus uses the following algorithm. He takes out of the repository the largest cookie which can fit in some place in the box and puts it there. Everything could be perfect but alas, in the repository the little walrus has infinitely many cookies of size 2 and larger, and there are no cookies of size 1, therefore, empty cells will remain in the box. Fangy wants to know how many empty cells will be left in the end.

方阳收集饼干。有一天,他决定拿一个盒子,并以某种方式将饼干放入其中。如果我们取一个大小为 k×kk \times k 的正方形,将其划分为 1×11 \times 1 的小方格,并将主对角线及其上方的所有方格涂色,则涂色区域的面积就等于一块大小为 kk 的饼干所占据的面积。方阳还有一个底面为 2n×2n2^n \times 2^n 的正方形盒子,该盒子也被划分为 1×11 \times 1 的小方格。在盒子中,饼干不能重叠,也不能翻转或旋转。图中分别展示了大小为 22 和 44 的饼干:

为了堆叠饼干,小海象采用如下算法:他从仓库中取出当前能放进盒子某个空位的最大尺寸的饼干,并将其放入该位置。一切本应完美,但不幸的是,仓库中只有无穷多个尺寸为 22 及更大的饼干,而没有尺寸为 11 的饼干,因此盒子中最终会留下一些空单元格。方阳想知道最后会剩下多少个空单元格。

输入格式

The first line contains a single integer n (0 ≤ n ≤ 1000).

第一行包含一个整数 nn(0 ≤ n ≤ 10000 \leq n \leq 1000)。

输出格式

Print the single number, equal to the number of empty cells in the box. The answer should be printed modulo 106 + 3.

输出单个数字,该数字等于盒子中空单元格的数量。答案需对 106+310^6 + 3 取模后输出。

输入输出样例

  • 输入#1

    3

    输出#1

    9

说明/提示

If the box possesses the base of 23 × 23 (as in the example), then the cookies will be put there in the following manner:

如果盒子的底面为 23×2323 \times 23(如示例所示),则饼干将按如下方式放置:

输入解题思路,AI测评打分。不知道怎么写?

首页