Submission #222145

#TimeUsernameProblemLanguageResultExecution timeMemory
222145VEGAnn새로운 문제 (COCI19_akvizna)C++14
0 / 130
8 ms512 KiB
#include <bits/stdc++.h> #define sz(x) ((int)x.size()) #define pii pair<int,int> #define ft first #define sd second #define MP make_pair #define all(x) x.begin(),x.end() #define PB push_back using namespace std; typedef long long ll; typedef long double ld; const int N = 3010; const ll OO = 1e18; const ld E = 1e-9; vector<int> vc; 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 = 1; i <= k; i++) for (int j = 0; j < n; j++){ for (int pr = j; pr <= n; pr++) { if (f[i - 1][pr] < -E) continue; ld ad = f[i - 1][pr] + 1.0 - ld(j) / ld(pr); if (f[i][j] + E < ad) f[i][j] = ad; } } cout << fixed << setprecision(10) << f[k][0]; return 0; }

Compilation message (stderr)

akvizna.cpp: In function 'int main()':
akvizna.cpp:22:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen("in.txt","r",stdin);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~
#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...