Submission #628424

#TimeUsernameProblemLanguageResultExecution timeMemory
628424hello_thereCatfish Farm (IOI22_fish)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "fish.h" using namespace std; typedef long long ll; const ll INF = 1e18; ll max_weights(int N, int M, vector <int> x, vector <int> y, vector <int> w) { ll int ans = 0; for(int x:w) ans+=x; return ans; }

Compilation message (stderr)

fish.cpp: In function 'll max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:10:3: error: two or more data types in declaration of 'ans'
   10 |   ll int ans = 0;
      |   ^~
fish.cpp:11:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |    for(int x:w) ans+=x;
      |                 ^~~
      |                 abs
fish.cpp:12:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |    return ans;
      |           ^~~
      |           abs