답안 #632189

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
632189 2022-08-19T15:23:44 Z khocengoren 메기 농장 (IOI22_fish) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>

#define int long long int
#define F first
#define S second
#define pb push_back

using namespace std;

const int N = 0;

struct Fish {
    int col, row;
    int weight;
};

#undef int
long long max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> w){
    vector<Fish>fish;
    for(int i=0;i<M;i++){
        fish.pb({X[i],Y[i],w[i]});
    }
    ll sum=0;
    for(auto i:fish){
        sum+=i.weight;
    }
    return sum;
}

Compilation message

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:23:5: error: 'll' was not declared in this scope
   23 |     ll sum=0;
      |     ^~
fish.cpp:25:9: error: 'sum' was not declared in this scope
   25 |         sum+=i.weight;
      |         ^~~
fish.cpp:27:12: error: 'sum' was not declared in this scope
   27 |     return sum;
      |            ^~~