| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 124178 | AyaBenSaad | Boat (APIO16_boat) | C++14 | 4 ms | 1400 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int M = 5e2 + 2;
int n, t[M], dp[M][M];
int solve (int id = 1, int per = 0) {
if (id == 1+n) return 1;
if (dp[id][per] != -1) return dp[id][per];
int x = (t[id] >= t[per] ? solve (id + 1, id) : 0);
dp[id][per] = solve (id + 1, per) + x;
return dp[id][per];
}
int main () {
scanf ("%d", &n);
int a;
for (int i = 1; i <= n; i++) scanf ("%d %d", &t[i], &a);
t[0] = -2e9;
memset (dp, -1, sizeof dp);
printf ("%d\n", solve()-1);
}
컴파일 시 표준 에러 (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... | ||||
