제출 #980171

#제출 시각아이디문제언어결과실행 시간메모리
980171vjudge1축구 경기장 (IOI23_soccer)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "soccer.h"


using namespace std;

int n;

int biggest_stadium(int N, std::vector<std::vector<int>> F){

    n=N;
    int p1=-1, p2=-1;
    int ans=0;
    for(int i=0; i<n && p1==-1; i++){
        for(int j=0; j<n; j++){
            if(F[i][j]==1){
                p1=i;
                p2=j;
                break;
            }
        }
    }
    ans=max(ans, n*n-(n-p1)*(n-p2));
    ans=max(ans, n*n-(p1+1)*(n-p2));
    ans= max(ans, n*n-(p1+1)*(p2+1));
    ans= max(ans, n*n-(n-p1)*(p2+1))
    return 0;
}

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

soccer.cpp: In function 'int biggest_stadium(int, std::vector<std::vector<int> >)':
soccer.cpp:26:37: error: expected ';' before 'return'
   26 |     ans= max(ans, n*n-(n-p1)*(p2+1))
      |                                     ^
      |                                     ;
   27 |     return 0;
      |     ~~~~~~                           
soccer.cpp:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
   28 | }
      | ^