#include "bits/stdc++.h"
using namespace std;
#define int long long
struct Fish {
int col, row;
int weight;
};
int sub1(const std::vector<Fish>& fishes) {
int res = 0;
for (const auto& fish : fishes) {
res += fish.weight;
}
return res;
}
int solve(int n, const std::vector<Fish>& fishes) {
if (std::all_of(
fishes.begin(), fishes.end(),
[] (const Fish& f) { return f.col % 2 == 0; })) {
return sub1(fishes);
}
return sub1(fishes);
}
#undef int
int max_weights(
int n, int nFish,
std::vector<int> x,
std::vector<int> y,
std::vector<int> w) {
std::vector<Fish> fishes;
for (int i = 0; i < n; ++i) {
fishes.push_back({x[i], y[i], w[i]});
}
return solve(n, fishes);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
24 ms |
6720 KB |
1st lines differ - on the 1st token, expected: '40313272768926', found: '2842210222' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
50 ms |
9988 KB |
1st lines differ - on the 1st token, expected: '40604614618209', found: '455743671' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
2248 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
212 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 |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
212 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 |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
212 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 |
Runtime error |
3 ms |
2248 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
24 ms |
6720 KB |
1st lines differ - on the 1st token, expected: '40313272768926', found: '2842210222' |
2 |
Halted |
0 ms |
0 KB |
- |