Submission #980164

# Submission time Handle Problem Language Result Execution time Memory
980164 2024-05-12T00:25:40 Z vjudge1 Soccer Stadium (IOI23_soccer) C++17
0 / 100
1 ms 600 KB
#include <algorithm>
#include <fstream>
#include <vector>
#include <queue>
#include <stack>
#include <iostream>
#include <cmath>
#include <queue>
#include <set>
#include <string>
#include <cstring>
#include <map>
#include <unordered_map>
#include <unordered_set>
#define F first
#define S second
#define PB push_back
using namespace std;
const long long MOD=1e9+7, INF=1e18;
const int INFI=1e9;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<pair<int, ii>> viii;
typedef vector<vii> vvii;
typedef vector<ll> vll;
typedef vector<vll> vvll;

int biggest_stadium(int n, vvi f){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int cnt=0, x, y;
    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
            if(f[i][j]==1){
                cnt++;
                y=i;    x=j;
            }
    if(cnt>1)   return 0;
    int ans=1;
    int aux=n*(n-1-y)+max((y+1)*x, (y+1)*(n-x-1));
    ans=max(ans, aux);
    aux=n*y+max((n-x-1)*(n-y), x*(n-y));
    ans=max(ans, aux);
    
    aux=n*x+max((n-x)*y, (n-x)*(n-y-1));
    ans=max(ans, aux);
    aux=n*(n-x-1)+max((x+1)*y, (x+1)*(n-y-1));
    ans=max(ans, aux);
    return ans;
}

Compilation message

soccer.cpp: In function 'int biggest_stadium(int, vvi)':
soccer.cpp:48:10: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
   48 |     aux=n*x+max((n-x)*y, (n-x)*(n-y-1));
      |         ~^~
soccer.cpp:45:10: warning: 'y' may be used uninitialized in this function [-Wmaybe-uninitialized]
   45 |     aux=n*y+max((n-x-1)*(n-y), x*(n-y));
      |         ~^~
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok
2 Correct 0 ms 356 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Incorrect 0 ms 600 KB wrong
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok
2 Correct 0 ms 356 KB ok
3 Partially correct 1 ms 348 KB partial
4 Partially correct 0 ms 348 KB partial
5 Partially correct 1 ms 348 KB partial
6 Partially correct 0 ms 344 KB partial
7 Partially correct 1 ms 344 KB partial
8 Incorrect 1 ms 344 KB wrong
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 356 KB ok
4 Partially correct 1 ms 348 KB partial
5 Partially correct 0 ms 348 KB partial
6 Partially correct 1 ms 348 KB partial
7 Partially correct 0 ms 344 KB partial
8 Partially correct 1 ms 344 KB partial
9 Incorrect 1 ms 344 KB wrong
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 356 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Partially correct 1 ms 348 KB partial
7 Partially correct 0 ms 348 KB partial
8 Partially correct 1 ms 348 KB partial
9 Partially correct 0 ms 344 KB partial
10 Partially correct 1 ms 344 KB partial
11 Incorrect 1 ms 344 KB wrong
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 356 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Partially correct 1 ms 348 KB partial
7 Partially correct 0 ms 348 KB partial
8 Partially correct 1 ms 348 KB partial
9 Partially correct 0 ms 344 KB partial
10 Partially correct 1 ms 344 KB partial
11 Incorrect 1 ms 344 KB wrong
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 356 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Incorrect 0 ms 600 KB wrong
7 Halted 0 ms 0 KB -