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

#1665. 【2022.10.19 联考】排列

https://sjzezoj.com/submission/61143
This commit is contained in:
Baoshuo Ren 2022-10-19 22:06:03 +08:00
parent 7abd918cdf
commit 7fd28acab2
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
22 changed files with 111 additions and 0 deletions

48
S2OJ/1665/1665.cpp Normal file
View File

@ -0,0 +1,48 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 1e6 + 5;
const int mod = 1e9 + 7;
int n;
long long f[N], ans;
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
if (n == 1) {
cout << 1 << endl;
exit(0);
}
f[1] = 1;
for (int j = 1; j < n; j++) {
if (j <= 3) {
for (int i = j + 1; i < n; i++) {
f[i] = (f[i] + f[j]) % mod;
}
} else {
for (int k = -1; k <= 1; k++) {
for (int i = j + k; i < n; i += j) {
if (j < i) f[i] = (f[i] + f[j]) % mod;
}
}
}
}
for (int i = 1; i < n; i++) {
ans = (ans + f[i]) % mod;
}
cout << ans * n % mod << endl;
return 0;
}

BIN
S2OJ/1665/data/permutation1.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation1.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation10.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation10.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation2.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation2.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation3.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation3.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation4.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation4.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation5.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation5.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation6.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation6.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation7.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation7.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation8.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation8.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation9.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/permutation9.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1665/data/problem.conf (Stored with Git LFS) Normal file

Binary file not shown.