Submission #1084520

# Submission time Handle Problem Language Result Execution time Memory
1084520 2024-09-06T11:01:46 Z thangdz2k7 Soccer Stadium (IOI23_soccer) C++17
0 / 100
0 ms 348 KB
// author : thembululquaUwU
// 3.9.2024

#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define endl '\n'

using namespace std;
using ll = long long;
using ii = pair <int, int>;
using vi = vector <int>;

const int MaxN = 2e5;
const int mod = 1e9 + 7;

void maxl(auto &a, auto b) {a = max(a, b);}
void minl(auto &a, auto b) {a = min(a, b);}

int biggest_stadium(int n, vector <vi> f){
//    if (n > 30){
        int ans = 0;
        vi l(n, -1), r(n, -1);
        int st = -1, ed = n;
        for (int i = 0; i < n; ++ i){
            int nt = 0;
            for (int j = 0; j < n; ++ j) {
                if (!f[i][j]){
                    if (l[i] == -1) l[i] = j;
                    r[i] = j; ++ ans;
                    if (st == -1) st = i; if (i > ed) return 0;
                    if (nt) return 0;
                }
                else if (l[i] != -1) nt = 1;
            }
            if (l[i] == -1) ed = i;
        }
        for (int i = st; i < ed; ++ i){
            for (int j = i + 1; j < ed; ++ j){
                if (l[i] <= l[j] && r[j] <= r[i]) continue;
                if (l[j] <= l[i] && r[i] <= r[j]) continue;
                return 0;
            }
        }

        for (int i = 0; i < n; ++ i) l[i] = -1, r[i] = -1;
        st = -1, ed = n;
        for (int j = 0; j < n; ++ j){
            int nt = 0;
            for (int i = 0; i < n; ++ i) {
                if (!f[i][j]){
                    if (l[j] == -1) l[j] = i;
                    r[j] = i; ++ ans;
                    if (st == -1) st = j; if (j > ed) return 0;
                    if (nt) return 0;
                }
                else if (l[j] != -1) nt = 1;
            }
            if (l[j] == -1) ed = j;
        }
        return ans;
    //}
}
//
//void solve(){
//
//}
//
//int main(){
//    if (fopen("pqh.inp", "r")){
//        freopen("pqh.inp", "r", stdin);
//        freopen("pqh.out", "w", stdout);
//    }
//    ios_base::sync_with_stdio(0);
//    cin.tie(0); cout.tie(0);
//
//    int t = 1; // cin >> t;
//    while (t --) solve();
//    return 0;
//}

Compilation message

soccer.cpp:18:11: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   18 | void maxl(auto &a, auto b) {a = max(a, b);}
      |           ^~~~
soccer.cpp:18:20: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   18 | void maxl(auto &a, auto b) {a = max(a, b);}
      |                    ^~~~
soccer.cpp:19:11: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   19 | void minl(auto &a, auto b) {a = min(a, b);}
      |           ^~~~
soccer.cpp:19:20: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   19 | void minl(auto &a, auto b) {a = min(a, b);}
      |                    ^~~~
soccer.cpp: In function 'int biggest_stadium(int, std::vector<std::vector<int> >)':
soccer.cpp:32:21: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   32 |                     if (st == -1) st = i; if (i > ed) return 0;
      |                     ^~
soccer.cpp:32:43: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   32 |                     if (st == -1) st = i; if (i > ed) return 0;
      |                                           ^~
soccer.cpp:55:21: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   55 |                     if (st == -1) st = j; if (j > ed) return 0;
      |                     ^~
soccer.cpp:55:43: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   55 |                     if (st == -1) st = j; if (j > ed) return 0;
      |                                           ^~
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
# 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 Partially correct 0 ms 348 KB partial
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -