답안 #1054471

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1054471 2024-08-12T10:08:46 Z Ahmed57 축구 경기장 (IOI23_soccer) C++17
48 / 100
4500 ms 897380 KB
#include "bits/stdc++.h"

using namespace std;
map<pair<int,int>,int> dp[501][501];
int n;
vector<pair<int,int>> rngs[501];
int solve(int l,int r,int x,int y){
    if(l==0&&r==n-1)return 0;
    if(dp[l][r].find(make_pair(x,y))!=dp[l][r].end())return dp[l][r][{x,y}];
    int ma = 0;
    if(l){
        for(auto j:rngs[l-1]){
            if(max(x,j.first)<=min(y,j.second)){
                ma = max(ma,solve(l-1,r,max(x,j.first),min(y,j.second))+(min(y,j.second)-max(x,j.first)+1));
            }
        } 
    }if(r<n-1){
        for(auto j:rngs[r+1]){
            if(max(x,j.first)<=min(y,j.second)){
                ma = max(ma,solve(l,r+1,max(x,j.first),min(y,j.second))+(min(y,j.second)-max(x,j.first)+1));
            }
        }
    }
    return dp[l][r][{x,y}] = ma;
}
int biggest_stadium(int N, vector<vector<int>> v){
    n = N;
    for(int i = 0;i<N;i++){
        int la = 0;
        for(int j = 0;j<N;j++){
            if(v[i][j]==0){
                if(la==-1)la = j;
            }else{
                if(la<j&&la!=-1)rngs[i].push_back({la,j-1});
                la = -1;
            }
        }
        if(la!=-1)rngs[i].push_back({la,N-1});
    }
    int all = 0;
    for(int i = 0;i<N;i++){
        for(auto j:rngs[i]){
            all= max(all,solve(i,i,j.first,j.second)+(j.second-j.first+1));
        }
    }
    return all;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 12120 KB ok
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 12120 KB ok
2 Correct 2 ms 12124 KB ok
3 Correct 2 ms 12124 KB ok
4 Correct 1 ms 12124 KB ok
5 Correct 2 ms 12124 KB ok
6 Correct 2 ms 12132 KB ok
7 Correct 3 ms 12636 KB ok
8 Correct 23 ms 24276 KB ok
9 Runtime error 215 ms 96080 KB Execution killed with signal 6
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 12120 KB ok
2 Correct 2 ms 12124 KB ok
3 Correct 2 ms 12124 KB ok
4 Correct 2 ms 12124 KB ok
5 Correct 2 ms 12124 KB ok
6 Correct 2 ms 12120 KB ok
7 Correct 2 ms 12124 KB ok
8 Correct 2 ms 12124 KB ok
9 Correct 2 ms 12124 KB ok
10 Correct 2 ms 12124 KB ok
11 Correct 2 ms 12120 KB ok
12 Correct 2 ms 12124 KB ok
13 Correct 2 ms 12124 KB ok
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 12120 KB ok
2 Correct 2 ms 12120 KB ok
3 Correct 2 ms 12124 KB ok
4 Correct 2 ms 12124 KB ok
5 Correct 2 ms 12124 KB ok
6 Correct 2 ms 12124 KB ok
7 Correct 2 ms 12120 KB ok
8 Correct 2 ms 12124 KB ok
9 Correct 2 ms 12124 KB ok
10 Correct 2 ms 12124 KB ok
11 Correct 2 ms 12124 KB ok
12 Correct 2 ms 12120 KB ok
13 Correct 2 ms 12124 KB ok
14 Correct 2 ms 12124 KB ok
15 Correct 2 ms 12124 KB ok
16 Correct 2 ms 12120 KB ok
17 Correct 2 ms 12124 KB ok
18 Correct 2 ms 12124 KB ok
19 Correct 2 ms 12124 KB ok
20 Correct 2 ms 12124 KB ok
21 Correct 2 ms 12124 KB ok
22 Correct 1 ms 12124 KB ok
23 Correct 1 ms 12124 KB ok
24 Correct 2 ms 12120 KB ok
25 Correct 2 ms 12124 KB ok
26 Correct 2 ms 12124 KB ok
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 12120 KB ok
2 Correct 2 ms 12120 KB ok
3 Correct 2 ms 12124 KB ok
4 Correct 2 ms 12124 KB ok
5 Correct 1 ms 12124 KB ok
6 Correct 2 ms 12124 KB ok
7 Correct 2 ms 12124 KB ok
8 Correct 2 ms 12124 KB ok
9 Correct 2 ms 12120 KB ok
10 Correct 2 ms 12124 KB ok
11 Correct 2 ms 12124 KB ok
12 Correct 2 ms 12124 KB ok
13 Correct 2 ms 12124 KB ok
14 Correct 2 ms 12120 KB ok
15 Correct 2 ms 12124 KB ok
16 Correct 2 ms 12124 KB ok
17 Correct 2 ms 12124 KB ok
18 Correct 2 ms 12120 KB ok
19 Correct 2 ms 12124 KB ok
20 Correct 2 ms 12124 KB ok
21 Correct 2 ms 12124 KB ok
22 Correct 2 ms 12124 KB ok
23 Correct 2 ms 12124 KB ok
24 Correct 1 ms 12124 KB ok
25 Correct 1 ms 12124 KB ok
26 Correct 2 ms 12120 KB ok
27 Correct 2 ms 12124 KB ok
28 Correct 2 ms 12124 KB ok
29 Correct 2 ms 12124 KB ok
30 Correct 2 ms 12380 KB ok
31 Correct 2 ms 12124 KB ok
32 Correct 2 ms 12124 KB ok
33 Correct 2 ms 12124 KB ok
34 Correct 2 ms 12136 KB ok
35 Correct 2 ms 12124 KB ok
36 Correct 2 ms 12124 KB ok
37 Correct 2 ms 12124 KB ok
38 Correct 2 ms 12124 KB ok
39 Correct 2 ms 12124 KB ok
40 Correct 2 ms 12124 KB ok
41 Correct 2 ms 12376 KB ok
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 12120 KB ok
2 Correct 2 ms 12120 KB ok
3 Correct 2 ms 12124 KB ok
4 Correct 2 ms 12124 KB ok
5 Correct 1 ms 12124 KB ok
6 Correct 2 ms 12124 KB ok
7 Correct 2 ms 12124 KB ok
8 Correct 2 ms 12124 KB ok
9 Correct 2 ms 12120 KB ok
10 Correct 2 ms 12124 KB ok
11 Correct 2 ms 12124 KB ok
12 Correct 2 ms 12124 KB ok
13 Correct 2 ms 12124 KB ok
14 Correct 2 ms 12120 KB ok
15 Correct 2 ms 12124 KB ok
16 Correct 2 ms 12124 KB ok
17 Correct 2 ms 12124 KB ok
18 Correct 2 ms 12120 KB ok
19 Correct 2 ms 12124 KB ok
20 Correct 2 ms 12124 KB ok
21 Correct 2 ms 12124 KB ok
22 Correct 2 ms 12124 KB ok
23 Correct 2 ms 12124 KB ok
24 Correct 1 ms 12124 KB ok
25 Correct 1 ms 12124 KB ok
26 Correct 2 ms 12120 KB ok
27 Correct 2 ms 12124 KB ok
28 Correct 2 ms 12124 KB ok
29 Correct 2 ms 12124 KB ok
30 Correct 2 ms 12380 KB ok
31 Correct 2 ms 12124 KB ok
32 Correct 2 ms 12124 KB ok
33 Correct 2 ms 12124 KB ok
34 Correct 2 ms 12136 KB ok
35 Correct 2 ms 12124 KB ok
36 Correct 2 ms 12124 KB ok
37 Correct 2 ms 12124 KB ok
38 Correct 2 ms 12124 KB ok
39 Correct 2 ms 12124 KB ok
40 Correct 2 ms 12124 KB ok
41 Correct 2 ms 12376 KB ok
42 Correct 275 ms 85588 KB ok
43 Correct 167 ms 49232 KB ok
44 Correct 1376 ms 550700 KB ok
45 Correct 1739 ms 735956 KB ok
46 Correct 518 ms 176144 KB ok
47 Correct 65 ms 62544 KB ok
48 Correct 19 ms 22364 KB ok
49 Correct 20 ms 21596 KB ok
50 Execution timed out 4621 ms 897380 KB Time limit exceeded
51 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 12120 KB ok
2 Correct 2 ms 12120 KB ok
3 Correct 2 ms 12124 KB ok
4 Correct 2 ms 12124 KB ok
5 Correct 1 ms 12124 KB ok
6 Correct 2 ms 12124 KB ok
7 Correct 2 ms 12132 KB ok
8 Correct 3 ms 12636 KB ok
9 Correct 23 ms 24276 KB ok
10 Runtime error 215 ms 96080 KB Execution killed with signal 6
11 Halted 0 ms 0 KB -