| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 105722 | Pro_ktmr | Boat (APIO16_boat) | C++14 | 16 ms | 4268 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define PB push_back
#define MP make_pair
#define MOD 1000000007
int N;
int a[500],b[500];
vector<int> zaatu;
LL dp[500][1001] = {};
LL solve(int now, int bef){
if(now == N) return 1LL;
if(dp[now][bef] != 0) return dp[now][bef];
LL ans = solve(now+1,bef);
if(zaatu[bef] < a[now]) ans += solve(now+1,lower_bound(zaatu.begin(), zaatu.end(), a[now])-zaatu.begin());
return dp[now][bef] = ans % MOD;
}
int main(){
scanf("%d", &N);
for(int i=0; i<N; i++){
scanf("%d%d", a+i, b+i);
b[i]++;
zaatu.PB(a[i]);
zaatu.PB(b[i]);
}
zaatu.PB(0);
sort(zaatu.begin(), zaatu.end());
cout << solve(0, 0) - 1 << endl;
}
컴파일 시 표준 에러 (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... | ||||
