Sicily 1620. SCVs and minerals Description
来源:互联网 发布:软件系统质量保证书 编辑:程序博客网 时间:2024/05/29 17:34
题目的意思是,每一个单位的SCV可以在一秒内收集到C个单位的矿物,而P个单位的矿物可以立即生产出一个单位的SCV,问S秒后最多可以得到多少矿物。
基本思路是,在每一个单位时间(秒)开始时,先计算下用矿物生产出SCV的话,能否在剩余的时间内收回成本,可以的话就生产尽可能多的SCV,否则就不生产。结果显而易见。
Run Time: 0sec
Run Memory: 312KB
Code length: 400Bytes
SubmitTime: 2012-01-26 21:41:50
// Problem#: 1620// Submission#: 1200290// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/// All Copyright reserved by Informatic Lab of Sun Yat-sen University#include <iostream>using namespace std;int main(){ int T; int N, M; int C, P, S; cin >> T; while ( T-- ) { cin >> N >> M >> C >> P >> S; for ( int i = 0; i < S; i++ ) { if ( C * ( S - i ) >= P ) { N += M / P; M %= P; } M += N * C; } cout << M << endl; } return 0;}
- Sicily 1620. SCVs and minerals Description
- Sicily 1620 SCVs and minerals
- Sicily 1620. SCVs and minerals 星际争霸简单策略
- Sicily 1199. GCD Description
- Sicily 1775. Simple Sort Description
- Sicily 1051. Biker's Trip Odomete Description
- ASCII table and description
- ASCII Table and Description
- EFLAGS description and implementation
- ASCII Table and Description
- Region Representaion and Description
- MorningSir AlarmClock (Description and Support)
- [Magento] Meta Description and SEO
- Saliency, Scale and Image Description
- Sicily 1798. Alice and Bob
- sicily 1491 Look and Say
- sicily--1798. Alice and Bob
- sicily--1007. To and Fro
- 读书笔记之Black Hats Manual Software Security Auditing, Cracking, Debugging
- Autohotkey守护程序的实现方法
- 公司内部PM系统设计
- 使用CMAKE编译单元测试代码发现如下问题
- .bss段和.data段的区别
- Sicily 1620. SCVs and minerals Description
- Ext.Net 1.x_Ext.Net.Combox动态加载与删除所选择项
- MySQL 5.1 分区技术初探
- textarea限定长度
- 谷歌三大核心技术(二)Google MapReduce中文版
- 软件开发的“三重门”
- FLex调用servlet连接数据库
- 提升PHP运行效率的10点建议
- Sicily 1628. Extended Normal Order Sort