'commit'
This commit is contained in:
14
TangDou/LuoGuBook/L1_11.cpp
Normal file
14
TangDou/LuoGuBook/L1_11.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
//题目给出的评测机数量和时间
|
||||
int n1 = 8, t1 = 30, n2 = 10, t2 = 6;
|
||||
int t3 = 10; //题目要求的时间10分钟
|
||||
double inc_rate = (1.0 * n1 * t1 - n2 * t2) / (t1 - t2);//增长速度,注意1.0的用途
|
||||
double init_num = n2 * t2 - inc_rate * t2;//初始化队列长度
|
||||
double ans = (init_num + t3 * inc_rate) / t3;//求得答案
|
||||
cout << ans << endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user