# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
756060 | yeyso | 메기 농장 (IOI22_fish) | C++17 | 86 ms | 7276 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
#include <vector>
/*
N - rows and columns
M - number of fish
X, Y - coordinates
W - weights
Y[i] = 0 means that we can only harvest up to 3 fish at a time
*/
long long max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) {
/*int subtask1 = 1;
int subtask2 = 1;
int subtask3 = 1;
long long res = 0;
for(int i = 0; i < W.size(); i ++){
if(X[i] % 2 == 0){
res += W[i];
} else {
subtask1 = 0;
}
if(Y[i] > 1){
subtask2 = 0;
}
}*/
long long res_left = 0;
long long res_right = 0;
for(int i = 0; i < W.size(); i ++){
if(X[i] == 0) res_left += W[i];
if(X[i] == 1) res_right += W[i];
}
return max(res_left, res_right);
/*vector<vector<int>> fish(M, vector<int>());
for(int i = 0; i < M; i ++){
}
if(subtask1){
return res;
} else if(subtask2){
return max(res_left, res_right);
}*/
}
/*
g++ -std=gnu++17 -O2 -Wall -pipe -static -o fish grader.cpp fish.cpp
5 6
0 1 1
0 3 1
0 2 4
1 1 5
1 0 6
1 4 5
*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |