답안 #628424

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
628424 2022-08-13T11:49:03 Z hello_there 메기 농장 (IOI22_fish) C++17
컴파일 오류
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