Submission #756060

#TimeUsernameProblemLanguageResultExecution timeMemory
756060yeysoCatfish Farm (IOI22_fish)C++17
0 / 100
86 ms7276 KiB
#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)

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:30:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |     for(int i = 0; i < W.size(); i ++){
      |                    ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...