Ural 1114 Boxes
Boxes
This problem will be judged on Ural. Original ID: 1114
64-bit integer IO format: %lld Java class name: (Any)
Input
Output
Sample Input
2 1 1
Sample Output
9
Source
#include <bits/stdc++.h>
using namespace std;
const int maxn = ;
unsigned long long dp[maxn][maxn][maxn];
int main() {
int N,A,B;
while(~scanf("%d%d%d",&N,&A,&B)) {
memset(dp,,sizeof dp);
dp[][][] = ;
for(int i = ; i <= N; ++i)
for(int j = ; j <= A; ++j)
for(int k = ; k <= B; ++k)
for(int a = ; a <= j; ++a)
for(int b = ; b <= k; ++b)
dp[i][j][k] += dp[i-][a][b];
unsigned long long ret = ;
for(int i = ; i <= A; ++i)
for(int j = ; j <= B; ++j)
ret += dp[N][i][j];
printf("%I64u\n",ret);
}
return ;
}
Ural 1114 Boxes的更多相关文章
- 1114. Boxes
1114. Boxes Time limit: 0.6 secondMemory limit: 64 MB N boxes are lined up in a sequence (1 ≤ N ≤ 20 ...
- ural 1114,计数dp
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1114 题意:N个盒子,a个红球,b个蓝球,把求放到盒子中去,没有任何限制,有多少种放法. ...
- noi 666 放苹果
题目链接:http://noi.openjudge.cn/ch0206/666/ 和ural 1114题意类似,但是有顺序,5,1,1和1,5,1是同一种序列.不能直接枚举 d(i,j) 前 i 个盘 ...
- ural 2069. Hard Rock
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...
- URAL 1873. GOV Chronicles
唔 神题一道 大家感受一下 1873. GOV Chronicles Time limit: 0.5 secondMemory limit: 64 MB A chilly autumn night. ...
- Fedora 24 Gnome Boxes 无法ping通网络
安装Fedora 24在试用虚拟机时发现无法ping通外网. 我傻傻地以为是软件问题. 问题描述: 尝试ping程序来测试网络连通性: (我之前也是ping百度,后来在为了少打字百度了一些比较短的域名 ...
- Problem B Boxes in a Line
省赛B题....手写链表..其实很简单的.... 比赛时太急了,各种手残....没搞出来....要不然就有金了...注:对相邻的元素需要特判..... Problem B Boxes in a Li ...
- hiho #1114 : 小Hi小Ho的惊天大作战:扫雷·一
#1114 : 小Hi小Ho的惊天大作战:扫雷·一 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 故事背景:密室.监视器与充满危机的广场 “我们还是循序渐进,先来考虑这 ...
- Codeforces Round #229 (Div. 2) C. Inna and Candy Boxes 树状数组s
C. Inna and Candy Boxes Inna loves sweets very much. She has n closed present boxes lines up in a ...
随机推荐
- GitHub安装使用教程
由于重复率比较大,为了尊重他人的成果,先在此注明本文是在学习了以下博文之后的一些总结归纳,并且说明了一些本人实际使用GitHub遇到的问题,并给出了解决办法 .本人的操作系统是window10,所 ...
- [SHOI2013]超级跳马
题目描述 现有一个n 行m 列的棋盘,一只马欲从棋盘的左上角跳到右下角.每一步它向右跳奇数列,且跳到本行或相邻行.跳越期间,马不能离开棋盘.试求跳法种数mod 30011. 输入输出格式 输入格式: ...
- C# 自动批量导入图片到数据库中
using Model; using System; using System.Collections.Generic; using System.Data; using System.Data.Sq ...
- ibatis入门教程一
这几天研究ibatis玩,参考一篇贴子进行安装配置:蓝雪森林 选择这个帖子来跟随配置是因为这个帖子看着比较干净,但是我仍旧在配置得过程中出现了好几个问题,所以我决定在这个帖子的基础上将更多细节加上,做 ...
- MySql学习笔记(1)-安装
一.安装环境 操作系统:win7 64ibt MySql版本:5.7.10.0 二.安装过程 1.点击Add 2.选择需要安装的组件 3.Excute 4.Next 5.Next 6.进入服务器配置 ...
- Javascript DOM 编程艺术(第二版)读书笔记——基本语法
Javascript DOM 编程艺术(第二版),英Jeremy Keith.加Jeffrey Sambells著,杨涛.王建桥等译,人民邮电出版社. 学到这的时候,我发现一个问题:学习过程中,相当一 ...
- SQL server 上机练习题
首先创建一个数据库,里面有 登录表 学生表 课程表 选课表 成绩表 1. 查询Student表中的所有记录的Sname.Ssex和Class列.2. 查询教师所有的单位即不重复的Depart列 ...
- Sonar 规则
bug类型: 1.".equals()" should not be used to test the values of "Atomic" classes. ...
- Hibernate+Spring整合开发步骤
Hibernate是一款ORM关系映射框架+Spring是结合第三方插件的大杂烩,Hibernate+Spring整合开发效率大大提升. 整合开发步骤如下: 第一步:导入架包: 1.Hibernate ...
- Codeforces_764_C. Timofey and a tree_(并查集)(dfs)
C. Timofey and a tree time limit per test 2 seconds memory limit per test 256 megabytes input standa ...