Submission #1366785

#TimeUsernameProblemLanguageResultExecution timeMemory
1366785mannshah1211Catfish Farm (IOI22_fish)C++20
Compilation error
0 ms0 KiB
#include "fish.h"
#include <bits/stdc++.h>
#include <vector>

const long long inf = (long long) 1e18;

long long max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w) {
  return accumulate(w.begin(), w.end(), static_cast<long long>(0));
}

Compilation message (stderr)

fish.cpp:7:37: error: 'vector' has not been declared
    7 | long long max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w) {
      |                                     ^~~~~~
fish.cpp:7:43: error: expected ',' or '...' before '<' token
    7 | long long max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w) {
      |                                           ^
fish.cpp: In function 'long long int max_weights(int, int, int)':
fish.cpp:8:21: error: 'w' was not declared in this scope
    8 |   return accumulate(w.begin(), w.end(), static_cast<long long>(0));
      |                     ^
fish.cpp:8:10: error: 'accumulate' was not declared in this scope; did you mean 'std::accumulate'?
    8 |   return accumulate(w.begin(), w.end(), static_cast<long long>(0));
      |          ^~~~~~~~~~
      |          std::accumulate
In file included from /usr/include/c++/13/numeric:62,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:58,
                 from fish.cpp:2:
/usr/include/c++/13/bits/stl_numeric.h:161:5: note: 'std::accumulate' declared here
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~