| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 44498 | arman_ferdous | Boat (APIO16_boat) | C++17 | 6 ms | 1996 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 510, inf = 2e9, mod = 1e9+7;
int n;
pair<int,int> arr[510];
int dp[510][510];
int dp_9pts(int pos, int prev) {
if(pos < 0) return 1;
if(dp[pos][prev] != -1) return dp[pos][prev];
int ret = dp_9pts(pos-1,prev) % mod;
if(arr[pos].first < arr[prev].first) ret = (ret + dp_9pts(pos-1,pos))%mod;
return dp[pos][prev] = ret;
}
void pts9() {
memset(dp,-1,sizeof dp);
arr[n].first = inf;
printf("%d\n", dp_9pts(n-1,n) - 1);
}
int main() {
scanf("%d", &n);
for(int i = 0; i < n; i++)
scanf("%d %d", &arr[i].first, &arr[i].second);
pts9();
return 0;
}
컴파일 시 표준 에러 (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... | ||||
