제출 #1358488

#제출 시각아이디문제언어결과실행 시간메모리
1358488rawi-ereij메기 농장 (IOI22_fish)C++20
컴파일 에러
0 ms0 KiB
#include "fish.h"

#include <vector>

long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y,
                      std::vector<int> W) {

    int n = N:
    int m = M;
    ll sum = 0;
    for(int i = 0;i<m;i++){
        sum+=W[i];
    }


    return sum;
}

컴파일 시 표준 에러 (stderr) 메시지

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:8:14: error: expected ',' or ';' before ':' token
    8 |     int n = N:
      |              ^
fish.cpp:10:5: error: 'll' was not declared in this scope
   10 |     ll sum = 0;
      |     ^~
fish.cpp:11:21: error: 'm' was not declared in this scope
   11 |     for(int i = 0;i<m;i++){
      |                     ^
fish.cpp:12:9: error: 'sum' was not declared in this scope
   12 |         sum+=W[i];
      |         ^~~
fish.cpp:16:12: error: 'sum' was not declared in this scope
   16 |     return sum;
      |            ^~~