A8151 | Cookies
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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.
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.
输入格式
The first line contains a single integer $n$ ( $0<=n<=1000$ ).
输出格式
Print the single number, equal to the number of empty cells in the box. The answer should be printed modulo $10^{6}+3$ .
输入输出样例
输入 #1
3
输出 #1
9
If the box possesses the base of $2^{3}×2^{3}$ (as in the example), then the cookies will be put there in the following manner:


C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted