#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. git 使用手册

    git 作为开源项目首选版本管理软件,必然其优势不容小觑,下面总结一下初次解除用到的一些技能 1. 基本命令介绍 git help branch 查看branch帮助文档 git branch -a ...

  2. mysql的优化基础知识

    1.查看各种SQL执行的频率 mysql> show status like 'Com_select';--Com_insert,Com_delete,connections(试图连接mysql ...

  3. 理解Loadrunner中的Browser Emulation Simulate

    案例 测试环境描述: 客户端 5台 Windows2000机器.服务器端  20台机器 一台F5(负载均衡设备,提供一个唯一的IP供客户端访问) 客户端绑定Host后,使用域名http://www.* ...

  4. MySQL Error: PROCEDURE xmdk.query_all_plan can't return a result set in the given context

    C++调用存储过程失败!出现如下错误:MySQL Error: PROCEDURE xmdk.query_all_plan can't return a result set in the given ...

  5. 第四篇:使用 CUBLAS 库给矩阵运算提速

    前言 编写 CUDA 程序真心不是个简单的事儿,调试也不方便,很费时.那么有没有一些现成的 CUDA 库来调用呢? 答案是有的,如 CUBLAS 就是 CUDA 专门用来解决线性代数运算的库. 本文将 ...

  6. FragmentStatePagerAdapter写法

    为了节省资源,分批加载数据//适配器class TabLayoutViewPagerAdapter extends FragmentStatePagerAdapter { public TabLayo ...

  7. iOS 笔试题

    转:http://blog.sina.com.cn/s/blog_b0c5954101014upb.html 1.截取字符串”20|http://www.621life.com“ 中 ‘|’字符前面及 ...

  8. JAVA基础之JDBC开发、JSTL语法、EL表达式与数据分页

    一.直接使用JDBC开发的问题 1.当表中的列很多时,需要写很长的SQL语句 还需要写大量 setXXX() 设置参数语句 读取数据时还需要写大量setXXXX()设置属性语句 2.非常容易出错,而且 ...

  9. Struts2中的类型转换与复杂对象配合使用

    form 标签可以被映射到一个属性的属性 manager.java package com.atguigu.struts2.model; import java.util.Date; public c ...

  10. poj1179 Polygon【区间DP】

    Polygon Time Limit: 1000MS   Memory Limit: 10000K Total Submissions:6633   Accepted: 2834 Descriptio ...