제출 #1330133

#제출 시각아이디문제언어결과실행 시간메모리
1330133alexaaa쌀 창고 (IOI11_ricehub)C++20
컴파일 에러
0 ms0 KiB
#include "ricehub.h"
using namespace std;
#include<bits/stdc++.h>

int besthub(int R, int L, int X[], long long B)
{
  int max_count = 0;
  for(int i = 1; i <= L; i ++){
    int count = 0;
    int total = 0;
    priority_queue<int,vector<int>,greater<int>> q;
    for(int j = 0; j < R; j++){
      q.push(abs(i-X[j]));

    }
    for(int m = 0; m < R; m++){
      total += q.top();
      q.pop();
      if(total > B){
        max_count = max(count, max_count);
        break;
      }
      count ++;

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

ricehub.cpp: In function 'int besthub(int, int, int*, long long int)':
ricehub.cpp:23:16: error: expected '}' at end of input
   23 |       count ++;
      |                ^
ricehub.cpp:16:31: note: to match this '{'
   16 |     for(int m = 0; m < R; m++){
      |                               ^
ricehub.cpp:23:16: error: expected '}' at end of input
   23 |       count ++;
      |                ^
ricehub.cpp:8:31: note: to match this '{'
    8 |   for(int i = 1; i <= L; i ++){
      |                               ^
ricehub.cpp:23:16: error: expected '}' at end of input
   23 |       count ++;
      |                ^
ricehub.cpp:6:1: note: to match this '{'
    6 | {
      | ^
ricehub.cpp:23:16: warning: no return statement in function returning non-void [-Wreturn-type]
   23 |       count ++;
      |                ^