# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
591915 | 2022-07-08T08:40:47 Z | l_reho | Horses (IOI15_horses) | C++14 | 215 ms | 524288 KB |
#include "horses.h" #include <stdio.h> #include <stdlib.h> static char _buffer[1024]; static int _currentChar = 0; static int _charsNumber = 0; static FILE *_inputFile, *_outputFile; #include <bits/stdc++.h> using namespace std; vector<vector<long long>> dp; int init(int N, int X[], int Y[]) { dp.assign(N, vector<long long>(1000, 0)); vector<long long> pref(N+1, 0); pref[0] = 1; for(int i = 1; i <= N; i++) pref[i] = pref[i-1] * X[i-1]; for(int i = 0; i <= pref[1]; i++) dp[0][i] = Y[0] * (pref[1]-i); for(int i = 1; i < N; i++){ for(int h = 0; h <= pref[i]; h++){ for(int k = 0; k <= X[i]*h; k++){ dp[i][X[i]*h-k] = max(dp[i][X[i]*h-k], dp[i-1][h] + k*Y[i]); } } } long long ans = 0; for(int i = 0; i <= pref[N]; i++){ ans = max(ans, dp[N-1][i]); } return ans; } int updateX(int pos, int val) { return 0; } int updateY(int pos, int val) { return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 2 ms | 304 KB | Output is correct |
3 | Correct | 5 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 0 ms | 340 KB | Output is correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
7 | Correct | 5 ms | 340 KB | Output is correct |
8 | Correct | 5 ms | 340 KB | Output is correct |
9 | Correct | 0 ms | 340 KB | Output is correct |
10 | Correct | 1 ms | 340 KB | Output is correct |
11 | Correct | 0 ms | 212 KB | Output is correct |
12 | Correct | 0 ms | 296 KB | Output is correct |
13 | Correct | 1 ms | 340 KB | Output is correct |
14 | Correct | 0 ms | 300 KB | Output is correct |
15 | Correct | 0 ms | 212 KB | Output is correct |
16 | Correct | 2 ms | 340 KB | Output is correct |
17 | Correct | 0 ms | 304 KB | Output is correct |
18 | Correct | 0 ms | 340 KB | Output is correct |
19 | Correct | 0 ms | 340 KB | Output is correct |
20 | Correct | 1 ms | 300 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 5 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 0 ms | 340 KB | Output is correct |
6 | Correct | 0 ms | 340 KB | Output is correct |
7 | Correct | 5 ms | 388 KB | Output is correct |
8 | Correct | 5 ms | 384 KB | Output is correct |
9 | Correct | 0 ms | 340 KB | Output is correct |
10 | Correct | 1 ms | 340 KB | Output is correct |
11 | Correct | 1 ms | 212 KB | Output is correct |
12 | Correct | 0 ms | 300 KB | Output is correct |
13 | Correct | 1 ms | 340 KB | Output is correct |
14 | Correct | 0 ms | 212 KB | Output is correct |
15 | Correct | 1 ms | 296 KB | Output is correct |
16 | Correct | 2 ms | 340 KB | Output is correct |
17 | Correct | 1 ms | 304 KB | Output is correct |
18 | Correct | 0 ms | 212 KB | Output is correct |
19 | Correct | 0 ms | 304 KB | Output is correct |
20 | Correct | 1 ms | 340 KB | Output is correct |
21 | Runtime error | 31 ms | 712 KB | Execution killed with signal 11 |
22 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 215 ms | 524288 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 2 ms | 340 KB | Output is correct |
3 | Correct | 6 ms | 340 KB | Output is correct |
4 | Correct | 0 ms | 340 KB | Output is correct |
5 | Correct | 1 ms | 340 KB | Output is correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
7 | Correct | 6 ms | 300 KB | Output is correct |
8 | Correct | 5 ms | 340 KB | Output is correct |
9 | Correct | 1 ms | 340 KB | Output is correct |
10 | Correct | 1 ms | 340 KB | Output is correct |
11 | Correct | 0 ms | 296 KB | Output is correct |
12 | Correct | 0 ms | 212 KB | Output is correct |
13 | Correct | 1 ms | 340 KB | Output is correct |
14 | Correct | 0 ms | 300 KB | Output is correct |
15 | Correct | 0 ms | 212 KB | Output is correct |
16 | Correct | 2 ms | 340 KB | Output is correct |
17 | Correct | 0 ms | 340 KB | Output is correct |
18 | Correct | 1 ms | 212 KB | Output is correct |
19 | Correct | 0 ms | 340 KB | Output is correct |
20 | Correct | 1 ms | 340 KB | Output is correct |
21 | Runtime error | 32 ms | 716 KB | Execution killed with signal 11 |
22 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 5 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 0 ms | 340 KB | Output is correct |
6 | Correct | 0 ms | 340 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Correct | 5 ms | 300 KB | Output is correct |
9 | Correct | 1 ms | 340 KB | Output is correct |
10 | Correct | 0 ms | 340 KB | Output is correct |
11 | Correct | 1 ms | 304 KB | Output is correct |
12 | Correct | 0 ms | 212 KB | Output is correct |
13 | Correct | 1 ms | 340 KB | Output is correct |
14 | Correct | 1 ms | 212 KB | Output is correct |
15 | Correct | 1 ms | 212 KB | Output is correct |
16 | Correct | 3 ms | 300 KB | Output is correct |
17 | Correct | 1 ms | 340 KB | Output is correct |
18 | Correct | 1 ms | 212 KB | Output is correct |
19 | Correct | 0 ms | 340 KB | Output is correct |
20 | Correct | 1 ms | 296 KB | Output is correct |
21 | Runtime error | 32 ms | 676 KB | Execution killed with signal 11 |
22 | Halted | 0 ms | 0 KB | - |