Submission #249535

# Submission time Handle Problem Language Result Execution time Memory
249535 2020-07-15T08:28:49 Z NONAME Akvizna (COCI19_akvizna) C++14
65 / 130
807 ms 262148 KB
#include  <bits/stdc++.h>
#define dbg(x) cerr << #x << " = " << x << "\n"
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie()
using namespace std;
using ll = long long;
using ld = long double;

int n, m;
ld f[5000][5000];

int main() {
    fast_io;

    cin >> n >> m;

    for (int i = 0; i <= m; ++i)
    for (int j = 0; j <= n; ++j)
        f[i][j] = -1;
    f[0][n] = 0;

    for (int t = 0; t < m; ++t)
    for (int i = 1; i <= n; ++i) {
        if (f[t][i] == -1)
            continue;

        for (int j = 1; j <= min(i, (n / (t + 1))); ++j)
            f[t + 1][i - j] = max(f[t + 1][i - j], f[t][i] + ld(j) / ld(i));
    }


    cout.precision(8); cout << fixed;
    cout << f[m][0];
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 512 KB Output is correct
3 Correct 1 ms 768 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 1 ms 512 KB Output is correct
3 Correct 1 ms 768 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 1 ms 512 KB Output is correct
3 Correct 1 ms 640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 640 KB Output is correct
3 Correct 1 ms 640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 249 ms 19840 KB Output is correct
2 Correct 376 ms 79224 KB Output is correct
3 Correct 348 ms 105208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 327 ms 27008 KB Output is correct
2 Correct 384 ms 68736 KB Output is correct
3 Correct 407 ms 114960 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 310 ms 21640 KB Output is correct
2 Correct 304 ms 46328 KB Output is correct
3 Correct 345 ms 108536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 319 ms 27520 KB Output is correct
2 Correct 410 ms 63736 KB Output is correct
3 Correct 363 ms 114296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 261 ms 18304 KB Output is correct
2 Correct 347 ms 61816 KB Output is correct
3 Correct 320 ms 97400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 220 ms 17920 KB Output is correct
2 Correct 433 ms 87288 KB Output is correct
3 Correct 425 ms 118392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 300 ms 17528 KB Output is correct
2 Correct 453 ms 87356 KB Output is correct
3 Correct 449 ms 129316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 281 ms 17016 KB Output is correct
2 Correct 358 ms 63864 KB Output is correct
3 Correct 379 ms 110828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 408 ms 25560 KB Output is correct
2 Correct 377 ms 71800 KB Output is correct
3 Correct 398 ms 115320 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 724 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 735 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 733 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 766 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 713 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 799 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 805 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 723 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 773 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 807 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 776 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 751 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 768 ms 262148 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -