mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
parent
7abd918cdf
commit
7fd28acab2
48
S2OJ/1665/1665.cpp
Normal file
48
S2OJ/1665/1665.cpp
Normal 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
BIN
S2OJ/1665/data/problem.conf
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user