- C. Intense Heat
- 废话不多说,直接上AC程序!
巧不巧,double能过。#include<bits/stdc++.h> using namespace std; double dp[5005][5005]; double ans = 0; int main(){int n,tk;cin >> n>>tk;for (int i=1;i<=n;i++){cin >> dp[i][1];}for (int i=1;i<=n;i++){for (int k = 1;i-k>=-1;k++){dp[i][k] = dp[i - 1][k - 1] + dp[i][1];if(k>=tk && ((double)dp[i][k]/k)>ans)ans = (double)dp[i][k]/k;}}cout <<setprecision(10)<<ans; }
详细解决方案
Codeforces #494 C.Intense Heat
热度:26 发布时间:2024-01-11 10:49:06.0
相关解决方案
- Codeforces Round #166 (Div. 二) D - Good Substrings
- Codeforces Round #165 (Div. 二)(完全)
- Codeforces Round #166 (Div. 二)
- Codeforces Round #167 (Div. 二 && Div.1)
- Codeforces Round #282 (Div. 二)-A. Digital Counter
- Codeforces Round #248 (Div. 一)——Nanami's Digital Board
- Codeforces 10C Digital Root 法令题
- Tutorial CodeForces Round 289 (Div.2) (Second Winter Computer Camp Selection 2015) 例题
- codeforces 492D Vanya and Computer Game(额。数学题?水题吧)
- codeforces #199 C. Cupboard and Balloons 例题
- Codeforces Round #199 (Div. 二) C. Cupboard and Balloons
- Codeforces Round #199 (Div. 二) C. Cupboard and Balloons
- Educational Codeforces Round 77 C. Infinite Fence
- codeforces 1272B Snow Walking Robot
- Codeforces Round #380 C. Road to Cinema .
- codeforces 55d A.Beautiful numbers 数位DP -
- 【图论】Codeforces Manthan Codefest18E Trips
- 【构造】Codeforces 1025E Colored Cubes
- 【图论】Codeforces 1019C Sergey's problem
- 【交互题】Codeforces 1019B The hat
- 【枚举】COdeforces 1019A Elections
- 【乱搞】Codeforces EDU37 Connected Components
- 【DP】Codeforces EDU37 Tanks
- Codeforces 456 Div2
- 15、Short-term CHP Heat Load Forecast Method based on Concatenated LSTMs
- Codeforces Round #411 (Div. 2) 题解
- codeforces 789 div2 题解
- codeforces 721B B. Passwords -- by lethalboyd
- Educational Codeforces Round 47 (Rated for Div. 2)F详解
- Codeforces Round #497 (Div. 2)D题详解