Submission #628424

# Submission time Handle Problem Language Result Execution time Memory
628424 2022-08-13T11:49:03 Z hello_there Catfish Farm (IOI22_fish) C++17
Compilation error
0 ms 0 KB
#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

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