#include<stdio.h>
#define N 10007
#define maxn 1000005
int dp[maxn];
int main()
{
dp[]=,dp[]=,dp[]=;
for(int i=;i<maxn;i++)
dp[i]=dp[i-]%N+dp[i-]%N+dp[i-]%N;
int n;
while(scanf("%d",&n)!=EOF)
printf("%d\n",dp[n]%N);
}

XDU 1109的更多相关文章

  1. BZOJ 1109: [POI2007]堆积木Klo

    1109: [POI2007]堆积木Klo Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 948  Solved: 341[Submit][Statu ...

  2. 【转】[退役]纪念我的ACM——headacher@XDU

    转自:http://hi.baidu.com/headacher/item/5a2ce1d50609091b20e25022 退役了,是时候总结一下我ACM的生涯了.虽然很舍不得,但这段回忆很值得纪念 ...

  3. ural 1109,NYOJ 239,匈牙利算法邻接表

    NYOJ 239:http://acm.nyist.net/JudgeOnline/problem.php?pid=239 ural 1109 :http://acm.timus.ru/problem ...

  4. HDU 1109

    http://acm.hdu.edu.cn/showproblem.php?pid=1109 一个范围内给一堆点,求到这些点的最短距离最大 模拟退火,温度是步长 #include <iostre ...

  5. zoj 1109 Language of FatMouse(map映照容器的典型应用)

    题目连接: acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1109 题目描述: We all know that FatMouse doe ...

  6. 1109 Group Photo (25 分)

    1109 Group Photo (25 分) Formation is very important when taking a group photo. Given the rules of fo ...

  7. PAT 1109 Group Photo[仿真][难]

    1109 Group Photo(25 分) Formation is very important when taking a group photo. Given the rules of for ...

  8. 1109: [POI2007]堆积木Klo

    1109: [POI2007]堆积木Klo https://lydsy.com/JudgeOnline/problem.php?id=1109 分析: 首先是dp,f[i]表示到第i个的最优值,f[i ...

  9. 51 nod 1109 01组成的N的倍数

    1109 01组成的N的倍数 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题  收藏  关注 给定一个自然数N,找出一个M,使得M > 0且M是N的倍数,并且 ...

随机推荐

  1. linux C之alarm函数 转

    原文出处:http://blog.sina.com.cn/s/blog_6a1837e90100uhl3.html alarm也称为闹钟函数,alarm()用来设置信号SIGALRM在经过参数seco ...

  2. 自己制作一个链表用来存储列表信息,并查找当前id信息,找上一条信息,下一条信息(信息浏览的时候方便使用)

    偶然看到某些网站在新闻详情中 ,往往是需要根据当前信息id获取到上一条信息和下一条信息的,而通常我们的做法是先获取当前信息,再获取上一条信息,再获取下一条信息,就需要发送三次查询才能够得到这些信息,一 ...

  3. recyclerView中的方法

    onCreateViewHolder(); onBindViewHolder(); getItemCount(); recyclerVIew中没有添加头布局和尾布局方法.可以用getItemViewT ...

  4. JSP内置对象——request 及其响应get和post请求的实例

    request对象客户端的请求信息被封装在request对象中,通过它才能了解到客户的需求,然后做出响应.它是HttpServletRequest类的实例.request对象具有请求域,即完成客户端的 ...

  5. Java实现简单的文件复制

    public class FileCopy { public static void main(String[] args) { String path = "d:\\1.txt" ...

  6. PMP 质量管理新7张图

    亲和图.关联图.系统图.矩阵图.网络图.pdpc.矩阵数据分析法

  7. LeetCode 笔记系列七 Substring with Concatenation of All Words

    题目:You are given a string, S, and a list of words, L, that are all of the same length. Find all star ...

  8. HDU 5667 Sequence(矩阵快速幂)

    Problem Description Holion August will eat every thing he has found. Now there are many foods,but he ...

  9. 解决存储过程中拼接的SQL字符串超长导致sql语句被截取的问题

    今天遇到了一个奇葩的问题:存储过程中的sql字符串拼接的太长,超出了分页存储过程执行sql参数的nvarchar(4000)的长度. 没办法,只能修改自己的存储过程,因为分页存储过程是不能动的. 开始 ...

  10. netty/example/src/main/java/io/netty/example/http/snoop/

    netty/example/src/main/java/io/netty/example/http/snoop at 4.1 · netty/netty https://github.com/nett ...