Submission #634100

#TimeUsernameProblemLanguageResultExecution timeMemory
634100Jovan26Catfish Farm (IOI22_fish)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; long long max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w){ long long rez = 0; bool s1 = true; bool s2 = true; ifor(int i=0;i<x.size();i++){ if(x[i]%2==1) s1 = false; if(x[i]>1) s2 = false; } if(s1) for(int i=0;i<w.size();i++) rez+=w[i]; if(s2){ long long m1 = 0; long long m2 = 0; for(int i=0;i<w.size();i++){ if(x[i]==0) m1+=w[i]; else m2+=w[i]; } rez=max(m1,m2); } return rez; }

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:7:7: error: expected primary-expression before 'int'
    7 |  ifor(int i=0;i<x.size();i++){
      |       ^~~
fish.cpp:7:15: error: 'i' was not declared in this scope
    7 |  ifor(int i=0;i<x.size();i++){
      |               ^
fish.cpp:12:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  for(int i=0;i<w.size();i++) rez+=w[i];
      |              ~^~~~~~~~~
fish.cpp:16:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |   for(int i=0;i<w.size();i++){
      |               ~^~~~~~~~~