답안 #980249

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
980249 2024-05-12T01:37:39 Z vjudge1 봉쇄 시간 (IOI23_closing) C++17
9 / 100
60 ms 5084 KB
#include <bits/stdc++.h>
#define rep(a,b,c) for(int a=b; a<c; a++)
#define repr(a,b,c) for(int a=b-1; a>c-1; a--)
#define repa(a,b) for(auto a:b)
#define ll long long
#define pll pair<ll, ll>
#define pb push_back
#define fi first
#define se second

using namespace std;

int max_score(int N, int X, int Y, ll K, vector<int> U, vector<int> V, vector<int> W){
	if(N>50) return N;
	ll nxt[N]{}, prv[N]{};
	rep(i,0,N-1) nxt[i]=W[i], prv[i+1]=W[i];
	int ans=0;
	ll dis[N], disx[N], disy[N];
	disx[X]=0;
	disy[Y]=0;
	rep(i,X+1,N) disx[i]=disx[i-1]+nxt[i-1];
	repr(i,X,0) disx[i]=disx[i+1]+prv[i+1];
	rep(i,Y+1,N) disy[i]=disy[i-1]+nxt[i-1];
	repr(i,Y,0) disy[i]=disy[i+1]+prv[i+1];
	rep(i,0,N) dis[i]=max(disx[i],disy[i]);
	rep(i,0,N){
		rep(j,0,N){
			rep(k,0,N){
				rep(l,0,N){
					if(j<X || i>X || k>Y || l<Y) continue;
					ll sum=0;
					rep(m,0,N){
						if(i<=m && m<=j && k<=m && m<=l) sum+=dis[m];
						else if(i<=m && m<=j) sum+=disx[m];
						else if(k<=m && m<=l) sum+=disy[m];
					}
					if(K>=sum) ans=max(ans,j+1-i+l+1-k);
					//cout<<i<<" "<<j<<" "<<k<<" "<<l<<" "<<sum<<" "<<(j+1-i+l+1-k)<<endl;
				}
			}
		}
	}
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 60 ms 5084 KB 1st lines differ - on the 1st token, expected: '451', found: '200000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 48 ms 408 KB Output is correct
7 Correct 41 ms 344 KB Output is correct
8 Correct 18 ms 344 KB Output is correct
9 Correct 7 ms 348 KB Output is correct
10 Correct 7 ms 348 KB Output is correct
11 Correct 10 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 48 ms 408 KB Output is correct
7 Correct 41 ms 344 KB Output is correct
8 Correct 18 ms 344 KB Output is correct
9 Correct 7 ms 348 KB Output is correct
10 Correct 7 ms 348 KB Output is correct
11 Correct 10 ms 348 KB Output is correct
12 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '173', found: '100'
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 48 ms 408 KB Output is correct
7 Correct 41 ms 344 KB Output is correct
8 Correct 18 ms 344 KB Output is correct
9 Correct 7 ms 348 KB Output is correct
10 Correct 7 ms 348 KB Output is correct
11 Correct 10 ms 348 KB Output is correct
12 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '173', found: '100'
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -