This commit is contained in:
Zengtudor 2024-12-08 12:12:53 +08:00
parent bf213d134c
commit 04c2bd2ff2
6 changed files with 47 additions and 1 deletions

2
.gitignore vendored
View File

@ -34,6 +34,6 @@
# Executables # Executables
*.exe *.exe
*.out # *.out
*.app *.app

View File

@ -0,0 +1,41 @@
/*
1~5(54)
455
S = C1*1 + C2*2 + C3*3 + C4*4 + C5*5
T = C1 + C2 + C3 + C4 + C5
K
S / T >= K 0
K为5
55
S == 5*T 0
5 -1
(S+5N)/(T+N)>=K
N>=(K*T-S)/(5-K)
*/
#include <cmath>
#include <cstdint>
#include <iostream>
using ll = int64_t;
int main(){
ll c[6];
double s=0.0;
ll t=0;
for(ll i=1;i<=5;i++){
std::cin>>c[i];
t+=c[i];
s+=double(i)*double(c[i]);
}
double k;
std::cin>>k;
std::cout<<std::ceil((k*double(t)-s)/(5.0-k)-1e-9)<<'\n';
}

View File

2
src/12/c6/homework.txt Normal file
View File

@ -0,0 +1,2 @@
BST
USACO

2
src/12/c6/r.in Normal file
View File

@ -0,0 +1,2 @@
10 20 30 25 15
4.0

1
src/12/c6/r.out Normal file
View File

@ -0,0 +1 @@
85