Submission #980171

#TimeUsernameProblemLanguageResultExecution timeMemory
980171vjudge1Soccer Stadium (IOI23_soccer)C++17
Compilation error
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;
}

Compilation message (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 | }
      | ^