mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 21:08:47 +00:00
parent
b0db86725c
commit
add707aaf1
46
S2OJ/896/896.cpp
Normal file
46
S2OJ/896/896.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
const int N = 6005;
|
||||
const int mod = 1e9 + 7;
|
||||
|
||||
int n, f[N][2], ans;
|
||||
std::pair<int, int> a[N];
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
cin >> n;
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
cin >> a[i].first >> a[i].second;
|
||||
}
|
||||
|
||||
std::sort(a + 1, a + 1 + n);
|
||||
|
||||
f[1][0] = f[1][1] = 1;
|
||||
for (int i = 2; i <= n; i++) {
|
||||
f[i][0] = f[i][1] = 1;
|
||||
|
||||
for (int j = i - 1; j; j--) {
|
||||
if (a[j].second > a[i].second) {
|
||||
f[j][1] = (f[j][1] + f[i][0]) % mod;
|
||||
} else {
|
||||
f[i][0] = (f[i][0] + f[j][1]) % mod;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
ans = (static_cast<long long>(ans) + f[i][0] + f[i][1] - 1) % mod;
|
||||
}
|
||||
|
||||
cout << ans << endl;
|
||||
|
||||
return 0;
|
||||
}
|
BIN
S2OJ/896/data/problem.conf
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/problem.conf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract1.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract1.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract1.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract10.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract10.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract10.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract2.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract2.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract2.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract3.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract3.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract3.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract4.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract4.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract4.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract5.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract5.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract5.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract6.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract6.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract6.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract6.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract7.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract7.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract7.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract7.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract8.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract8.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract8.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract8.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract9.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract9.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/896/data/refract9.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/896/data/refract9.out
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user