0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 18:28:47 +00:00

#896. 「雅礼集训 2018 Day1」折射(refract)

https://sjzezoj.com/submission/58303
This commit is contained in:
Baoshuo Ren 2022-09-28 17:16:05 +08:00
parent b0db86725c
commit add707aaf1
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
22 changed files with 109 additions and 0 deletions

46
S2OJ/896/896.cpp Normal file
View 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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.