Submission #222113

#TimeUsernameProblemLanguageResultExecution timeMemory
222113VEGAnn새로운 문제 (COCI19_akvizna)C++14
20 / 130
1598 ms262144 KiB
#include <bits/stdc++.h> #define pii pair<int,int> #define ft first #define sd second using namespace std; typedef long long ll; typedef long double ld; const int N = 3010; const ll OO = 1e18; const ld E = 1e-9; ld f[N][N]; int n, k; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); // freopen("in.txt","r",stdin); cin >> n >> k; for (int i = 0; i <= k; i++) for (int j = 0; j <= n; j++) f[i][j] = -1.0; f[0][n] = 0.0; for (int i = 0; i < k; i++) for (int j = 1; j <= n; j++){ if (f[i][j] < -E) continue; for (int nw = 1; nw <= j; nw++) { ld ad = f[i][j] + ld(nw) / ld(j); if (f[i + 1][j - nw] + E < ad) f[i + 1][j - nw] = ad; } } cout << fixed << setprecision(10) << f[k][0]; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...