POJ 2336
#include <iostream>
using namespace std; int main()
{
//freopen("acm.acm","r",stdin);
int test;
int n;
int t;
int m;
int odd;
int mul;
int i;
int j;
int time;
int time_1;
cin>>test; while(test --)
{
cin>>n;
cin>>t;
cin>>m;
mul = m / n;
odd = m % n;
time_1 = ;
if(odd != )
{
for(i = ; i < odd; ++ i)
{
cin>>time;
}
time_1 = time + *t;
}
// cout<<time_1<<endl;
// time_1
for(i = ; i < mul; ++ i)
{
for(j = ; j < n; ++ j)
{
cin>>time;
} if(time < time_1)
{
time_1 = time_1 + *t;
}
else
{
time_1 = time + *t;
}
} cout<<time_1-t<<" "<<mul + !(odd == )<<endl; }
}
POJ 2336的更多相关文章
- AtCoder - agc043_a 和 POJ - 2336 dp
题意: 给你一个n行m列由'#'和'.'构成的矩阵,你需要从(1,1)点走到(n,m)点,你每次只能向右或者向下走,且只能走'.'的位置. 你可以执行操作改变矩阵: 你可以选取两个点,r0,c0;r1 ...
- POJ - 2336 Wireless Network
Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have ...
- poj 2336 Ferry Loading II ( 【贪心】 )
Ferry Loading II Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3704 Accepted: 1884 ...
- poj 题目分类(1)
poj 题目分类 按照ac的代码长度分类(主要参考最短代码和自己写的代码) 短代码:0.01K--0.50K:中短代码:0.51K--1.00K:中等代码量:1.01K--2.00K:长代码:2.01 ...
- POJ题目分类(按初级\中级\高级等分类,有助于大家根据个人情况学习)
本文来自:http://www.cppblog.com/snowshine09/archive/2011/08/02/152272.spx 多版本的POJ分类 流传最广的一种分类: 初期: 一.基本算 ...
- poj 动态规划题目列表及总结
此文转载别人,希望自己能够做完这些题目! 1.POJ动态规划题目列表 容易:1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 11 ...
- poj动态规划列表
[1]POJ 动态规划题目列表 容易: 1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1208, 1276, 13 ...
- POJ题目细究
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP: 1011 NTA 简单题 1013 Great Equipment 简单题 102 ...
- POJ 动态规划题目列表
]POJ 动态规划题目列表 容易: 1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1208, 1276, 1322 ...
随机推荐
- 2018.09.09 poj2949Word Rings(01分数规划+spfa判环)
传送门 这题要先巧妙的转化一下. 对于每个字符串,我们把头尾的两个小字符串对应的点连边,边权是这个字符串的长度. 这样最多会出现26*26个点. 这个时候就只用求出边权和跟边数的最大比值了. 这个显然 ...
- hdu-2191(完全背包+二进制优化模板)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2191 思路:完全背包模板 #include<iostream> #include<c ...
- 第五章:动词(Les verbes)
★及物动词(Les verbes transitifs) 主语发出的动作作用于人或物,它又分为两类,直接及物动词和间接及物动词. ()直接及物动词:动词直接带宾语,不需要介词引导.如: ...
- IntellJ IDEA javax.servlet.ServletException 找不到javax.servlet.ServletException的类 java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
误状态:错误显示 解决: (1)说明缺少包---->添加如下包配置 <dependency> <groupId>javax.servlet.jsp</groupId ...
- UVa 210 Concurrency Simulator (双端队列+模拟)
题意:给定n个程序,每种程序有五种操作,分别为 var = constant(赋值),print var (打印), lock, unlock,end. 变量用小写字母表示,初始化为0,为程序所公有( ...
- @Autowired 和 @Qualifier
一 无冲突 bean工厂 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns=" ...
- 简单的cxf-ws 基于web容器
pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w ...
- 20155320 2016-2017-2 《Java程序设计》第7周学习总结
20155320 2016-2017-2 <Java程序设计>第7周学习总结 教材学习内容总结 时间与日期 认识时间与日期 时间的度量 GMT(Greenwich Mean Time)时间 ...
- Qt .pro文件 详解
1. TEMPLATE变量TEMPLATE描述了为建立目标文件而采用何种模板,即生成何种形式的Makefile文件.Qmake工具定义了5种模板:1. 应用程序App,为建立一个Qt应用程序创建Mak ...
- PAT甲 1002. A+B for Polynomials (25) 2016-09-09 22:50 64人阅读 评论(0) 收藏
1002. A+B for Polynomials (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue T ...