Submission #1065259

# Submission time Handle Problem Language Result Execution time Memory
1065259 2024-08-19T04:57:55 Z LittleOrange Soccer Stadium (IOI23_soccer) C++17
6 / 100
195 ms 39560 KB
#include "soccer.h"
#include<bits/stdc++.h>
using namespace std;
using ll = int;
struct pos{
    ll x,y;
    bool operator<(const pos &o) const{
        return x!=o.x?x<o.x:y<o.y;
    }
};
struct dsu{
    ll c;
    vector<ll> p;
    dsu(ll N):c(N),p(N,-1){}
    ll g(ll i){
        return p[i]<0?i:p[i] = g(p[i]);
    }
    bool m(ll a, ll b){
        a = g(a),b=g(b);
        if(a==b) return false;
        c--;
        if(p[a]>p[b]) swap(a,b);
        p[a] += p[b];
        p[b] = a;
        return true;
    }
};
int biggest_stadium(int N, std::vector<std::vector<int>> F)
{
    auto &a = F;
    ll n = N;
    vector<pos> v;
    for(ll i = 0;i<n;i++){
        for(ll j = 0;j<n;j++){
            if (F[i][j]){
                ll v1 = j*n+(n-i-1)*(n-j);
                ll v2 = j*n+i*(n-j);
                ll v3 = (n-j-1)*n+(n-i-1)*(j+1);
                ll v4 = (n-j-1)*n+i*(j+1);
                return max({v1,v2,v3,v4});
            }
        }
    }
    return n*n;
    return 0;
}

Compilation message

soccer.cpp: In function 'int biggest_stadium(int, std::vector<std::vector<int> >)':
soccer.cpp:30:11: warning: unused variable 'a' [-Wunused-variable]
   30 |     auto &a = F;
      |           ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Correct 0 ms 348 KB ok
7 Correct 1 ms 348 KB ok
8 Correct 12 ms 2688 KB ok
9 Correct 195 ms 39560 KB ok
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Partially correct 0 ms 348 KB partial
6 Partially correct 0 ms 344 KB partial
7 Partially correct 0 ms 348 KB partial
8 Incorrect 0 ms 348 KB wrong
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong
2 Halted 0 ms 0 KB -