Submission #739745

#TimeUsernameProblemLanguageResultExecution timeMemory
739745NonozeCatfish Farm (IOI22_fish)C++17
3 / 100
90 ms13912 KiB
#include "fish.h" #include <bits/stdc++.h> using namespace std; long long max_weights(int n, int m, vector<int> X, vector<int> Y, vector<int> W) { #define int long long bool tacha=true, tachb=true, tachc=true; for (int i = 0; i < m; ++i) { if (X[i]%2) tacha=false; if (X[i]>1) tachb=false; if (Y[i]) tachc=false; } if (tacha) { int ans=0; for (int i = 0; i < m; ++i) ans+=W[i]; return ans; } if (tachb) { int sommegauche=0, sommedroite=0; for (int i = 0; i < m; ++i) { if (X[i]==0) sommegauche+=W[i]; else sommedroite+=W[i]; } return max(sommegauche, sommedroite); } #undef int return 0; }

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:10:31: warning: variable 'tachc' set but not used [-Wunused-but-set-variable]
   10 |  bool tacha=true, tachb=true, tachc=true;
      |                               ^~~~~
#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...