# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1056328 |
2024-08-13T08:53:28 Z |
dozer |
Catfish Farm (IOI22_fish) |
C++17 |
|
81 ms |
28888 KB |
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
#define sp " "
#define endl "\n"
#define pii pair<int, int>
#define st first
#define nd second
#define fileio() freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define fastio() cin.tie(0), ios_base::sync_with_stdio(0)
#define pb push_back
#define ll long long
#define LL node * 2
#define RR node * 2 + 1
#define MAXN 300005
const int modulo = 1e9 + 7;
const ll INF = 2e18 + 7;
long long max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) {
int n = N, m = M;
vector<array<int, 3>> v;
for (int i = 0; i < m; i++) v.pb({X[i], Y[i], W[i]});
sort(v.begin(), v.end());
vector<int> x(m, 0), y(m, 0), w(m, 0);
for (int i = 0; i < m; i++){
x[i] = v[i][0], y[i] = v[i][1], w[i] = v[i][2];
}
vector<vector<ll>> dp(2, vector<ll> (m + 5, 0));
vector<vector<ll>> start(2, vector<ll> (n + 5, 0));
vector<vector<pii>> fish(n + 5);
vector<ll> pre(m + 5, 0);
pre[0] = w[0];
for (int i = 1; i < m; i++) pre[i] = pre[i - 1] + w[i];
return pre[m - 1];
}
/*
int main() {
fileio();
int N, M;
assert(2 == scanf("%d %d", &N, &M));
std::vector<int> X(M), Y(M), W(M);
for (int i = 0; i < M; ++i) {
assert(3 == scanf("%d %d %d", &X[i], &Y[i], &W[i]));
}
long long result = max_weights(N, M, X, Y, W);
printf("%lld\n", result);
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
10188 KB |
Output is correct |
2 |
Correct |
26 ms |
11192 KB |
Output is correct |
3 |
Correct |
2 ms |
4172 KB |
Output is correct |
4 |
Correct |
2 ms |
4172 KB |
Output is correct |
5 |
Correct |
81 ms |
28888 KB |
Output is correct |
6 |
Correct |
80 ms |
28376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
45 ms |
15256 KB |
1st lines differ - on the 1st token, expected: '40604614618209', found: '80901044391025' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4172 KB |
Output is correct |
2 |
Correct |
2 ms |
4172 KB |
Output is correct |
3 |
Incorrect |
14 ms |
7536 KB |
1st lines differ - on the 1st token, expected: '21261825233649', found: '26722970331638' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
1st lines differ - on the 1st token, expected: '4044', found: '6066' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
1st lines differ - on the 1st token, expected: '4044', found: '6066' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
1st lines differ - on the 1st token, expected: '4044', found: '6066' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4172 KB |
Output is correct |
2 |
Correct |
2 ms |
4172 KB |
Output is correct |
3 |
Incorrect |
14 ms |
7536 KB |
1st lines differ - on the 1st token, expected: '21261825233649', found: '26722970331638' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
10188 KB |
Output is correct |
2 |
Correct |
26 ms |
11192 KB |
Output is correct |
3 |
Correct |
2 ms |
4172 KB |
Output is correct |
4 |
Correct |
2 ms |
4172 KB |
Output is correct |
5 |
Correct |
81 ms |
28888 KB |
Output is correct |
6 |
Correct |
80 ms |
28376 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Incorrect |
45 ms |
15256 KB |
1st lines differ - on the 1st token, expected: '40604614618209', found: '80901044391025' |
9 |
Halted |
0 ms |
0 KB |
- |