Submission #836698

#TimeUsernameProblemLanguageResultExecution timeMemory
836698SupersonicCatfish Farm (IOI22_fish)C++17
Compilation error
0 ms0 KiB
#include "fish.h" #include <bits/stdc++.h> using namespace std; long long max_weights(int n, int m, std::vector<int> x, std::vector<int> y, std::vector<int> w) { bool s1=1,s2=1; for(auto i:x){if(i%2==1)s1=0;if(i>=2)s2=0;} if(s1){ long long t=0; for(auto i:w)t+=w; return t; } 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:11:19: error: no match for 'operator+=' (operand types are 'long long int' and 'std::vector<int>')
   11 |     for(auto i:w)t+=w;
      |                  ~^~~
fish.cpp:11:14: warning: unused variable 'i' [-Wunused-variable]
   11 |     for(auto i:w)t+=w;
      |              ^