| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 25578 | khsoo01 | 스트랩 (JOI14_straps) | C++11 | 29 ms | 33456 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define X first
#define Y second
using namespace std;
typedef long long ll;
const ll inf = 1e18;
ll n, dt[2005][2005];
pair<ll,ll> a[2005];
int main()
{
	scanf("%lld",&n);
	for(ll i=1;i<=n;i++) {
		scanf("%lld%lld",&a[i].X,&a[i].Y);
		a[i].X *= -1;
	}
	sort(a+1, a+1+n);
	for(ll i=1;i<=n;i++) a[i].X *= -1;
	for(ll i=0;i<=n;i++) {
		for(ll j=0;j<=n;j++) dt[i][j] = -inf;
	}
	dt[0][1] = 0;
	for(ll i=1;i<=n;i++) {
		dt[i][0] = dt[i-1][0];
		for(ll j=1;j<=n;j++) {
			dt[i][j] = max(dt[i][j], dt[i-1][j]);
			if(j + a[i].X - 1 >= 0) {
				ll X = min(n, j+a[i].X-1);
				dt[i][X] = max(dt[i][X], dt[i-1][j] + a[i].Y);
			}
		}
	}
	ll ans = 0;
	for(ll i=0;i<=n;i++) ans = max(ans, dt[n][i]);
	printf("%lld\n",ans);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
