# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
668374 | danikoynov | Boat (APIO16_boat) | C++14 | 2 ms | 316 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/**
____ ____ ____ ____ ____ ____
||l |||e |||i |||n |||a |||d ||
||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/__\|
**/
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
void speed()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
const int maxn = 510;
const ll mod = 1e9 + 7;
int n, a[maxn], b[maxn];
ll dp[maxn];
void solve()
{
cin >> n;
for (int i = 1; i <= n; i ++)
cin >> a[i] >> b[i];
ll ans = 0;
for (int i = 1; i <= n; i ++)
{
dp[i] = 1;
for (int j = 1; j < i; j ++)
{
if (a[i] > a[j])
dp[i] = (dp[i] + dp[j]) % mod;
}
ans = (ans + dp[i]) % mod;
}
cout << ans << endl;
}
int main()
{
solve();
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... |