Submission #1059129

#TimeUsernameProblemLanguageResultExecution timeMemory
1059129hasan2006Soccer Stadium (IOI23_soccer)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "soccer.h"
using namespace std;

#define TL ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define rall(s) s.rbegin(),s.rend()
#define all(s) s.begin(),s.end()
#define pb push_back
#define se second
#define fi first
#define ll long long
#define ld long double
#define YES cout<<"YES\n"
#define Yes cout<<"Yes\n"
#define yes cout<<"yes\n"
#define NO cout<<"NO\n"
#define No cout<<"No\n"
#define no cout<<"no\n"


const int N = 5e5 + 9 , mod = 1e9 + 7;
ll a[N] , b[N] , dp[N] , c[N] , d[N];


int biggest_stadium(int n , vector<vector<int>>a) {
    ll i , j ,  l,  r , s  = 0 , f  = 0 , x , y , k , m ;
    for(i = 0; i < n; i++) {
        s = 0;
        for(j = 0; j < n; j++) {
            f += 1 - a[i][j];
            if(a[i][j] == 0 && s == 0)
                s = 1;
            else if(a[i][j] == 1 && s == 1)
                s = 2;
            else if(a[i][j] == 0 && s == 2)
                s = -1;
        }
        if(s == -1)
            return n * n + 1;
    }
    for(i = 0; i < n; i++) {
        s = 0;
        for(j = 0; j < n; j++) {
            if(a[j][i] == 0 && s == 0)
                s = 1;
            else if(a[j][i] == 1 && s == 1)
                s = 2;
            else if(a[j][i] == 0 && s == 2)
                s = -1;
        }
        if(s == -1)
            return n * n + 1;
    }
    return f;
}
int main() {
    cout<<biggest_stadium(3 , {{1 , 0 , 0} , {0 , 1 , 0} , {0 , 0 , 0}})<<"\n";
}

Compilation message (stderr)

soccer.cpp: In function 'int biggest_stadium(int, std::vector<std::vector<int> >)':
soccer.cpp:26:17: warning: unused variable 'l' [-Wunused-variable]
   26 |     ll i , j ,  l,  r , s  = 0 , f  = 0 , x , y , k , m ;
      |                 ^
soccer.cpp:26:21: warning: unused variable 'r' [-Wunused-variable]
   26 |     ll i , j ,  l,  r , s  = 0 , f  = 0 , x , y , k , m ;
      |                     ^
soccer.cpp:26:43: warning: unused variable 'x' [-Wunused-variable]
   26 |     ll i , j ,  l,  r , s  = 0 , f  = 0 , x , y , k , m ;
      |                                           ^
soccer.cpp:26:47: warning: unused variable 'y' [-Wunused-variable]
   26 |     ll i , j ,  l,  r , s  = 0 , f  = 0 , x , y , k , m ;
      |                                               ^
soccer.cpp:26:51: warning: unused variable 'k' [-Wunused-variable]
   26 |     ll i , j ,  l,  r , s  = 0 , f  = 0 , x , y , k , m ;
      |                                                   ^
soccer.cpp:26:55: warning: unused variable 'm' [-Wunused-variable]
   26 |     ll i , j ,  l,  r , s  = 0 , f  = 0 , x , y , k , m ;
      |                                                       ^
/usr/bin/ld: /tmp/ccgs8pM8.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccAnpyz9.o:soccer.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status