#include <bits/stdc++.h>
#define f0(i, n) for(int i=(0); i<n; i++)
#define f1(i, n) for(int i=(1); i<=n; i++)
#define x first
#define y second
#define mod 1000000007
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
const int N = 502;
int n;
pii a[N];
void sub1(){
vector <int> f(n + 3, 0);
f1(i, n){
f[i] = 1;
for(int j = i - 1; j >= 1; j--){
if(a[j].x < a[i].x){
f[i] = (f[i] + f[j])%mod;
}
}
}
int res = 1;
f1(i, n) res = (res + f[i])%mod;
cout << res;
exit(0);
}
main(){
ios_base::sync_with_stdio(0);
bool giong = 1;
cin >> n;
f1(i, n){
cin >> a[i].x >> a[i].y;
if(a[i].x != a[i].y) giong = 0;
}
if(giong) sub1();
}
Compilation message
boat.cpp:32:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main(){
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
380 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
380 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
380 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
380 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |