Cookies
来源:互联网 发布:产业链大数据分析系统 编辑:程序博客网 时间:2024/06/01 09:38
Description
Fangy collects cookies. Once he decided to take a box and put cookies into it in some way. If we take a squarek × k in size, divided into blocks1 × 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 cookiek in size. Fangy also has a box with a square base2n × 2n, divided into blocks1 × 1 in size. In a box the cookies should not overlap, and they should not be turned over or rotated. See cookies of sizes2 and 4 respectively on the figure:
Input
The first line contains a single integer n (0 ≤ n ≤ 1000).
Output
Print the single number, equal to the number of empty cells in the box. The answer should be printed modulo106 + 3.
Sample Input
3
9
Sample Output
Hint
If the box possesses the base of 23 × 23 (as in the example), then the cookies will be put there in the following manner:
#include <stdio.h>#include <string.h>#include <math.h>int main(){ int n, i, a = 1; long long m = 1; scanf("%d", &n); for (i = 1; i < 7; i++) { a = a * 10; } for (i = 1; i < n; i++) { m = m * 3; m = m % (a + 3); } if (n == 0) printf("1\n"); else printf("%lld\n", m); return 0;}
- cookies
- Cookies
- Cookies
- Cookies
- Cookies
- Cookies
- cookies()
- Cookies
- Cookies
- Cookies
- Cookies
- Cookies
- cookies
- cookies
- Cookies
- Cookies
- cookies
- cookies
- Maven创建web项目
- 安卓学习笔记(一)——线程的用法及怎样在子线程中更新UI
- Win7+VS2010环境下OpenCL配置
- linux设备驱动归纳总结(十二):简单的数码相框
- 第一次使用blog,测试一下!
- Cookies
- iOS代码性能优化
- 欢迎使用CSDN-markdown编辑器
- 第十三章编程练习(3)
- 用matlab实现二值化图像的一个问题
- 值类型与用类型之间的装箱与拆箱操作
- JavaScript基础知识之Array类型(二)
- iOS 图标上的数字
- Redis学习--Hash类型