mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 13:56:26 +00:00
parent
077fe99d5d
commit
7abd918cdf
42
S2OJ/1664/1664.cpp
Normal file
42
S2OJ/1664/1664.cpp
Normal file
@ -0,0 +1,42 @@
|
||||
#include <iostream>
|
||||
#include <numeric>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
const int N = 1e5 + 5;
|
||||
|
||||
int n, m, c[N];
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
cin >> n >> m;
|
||||
|
||||
while (n--) {
|
||||
int l, r;
|
||||
|
||||
cin >> l >> r;
|
||||
|
||||
l--;
|
||||
|
||||
for (int i = 1, j = 0; i <= r; i = j + 1) {
|
||||
if (l / i == 0) j = r;
|
||||
else j = std::min(l / (l / i), r / (r / i));
|
||||
|
||||
if (r / i - l / i > 0) {
|
||||
c[i]++, c[j + 1]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::partial_sum(c + 1, c + 1 + m, c + 1);
|
||||
|
||||
for (int i = 1; i <= m; i++) {
|
||||
cout << c[i] << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
BIN
S2OJ/1664/data/ex_souvenir1.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/ex_souvenir1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/ex_souvenir1.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/ex_souvenir1.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/ex_souvenir2.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/ex_souvenir2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/ex_souvenir2.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/ex_souvenir2.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/problem.conf
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/problem.conf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir1.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir1.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir1.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir10.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir10.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir10.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir2.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir2.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir2.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir3.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir3.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir3.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir4.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir4.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir4.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir5.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir5.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir5.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir6.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir6.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir6.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir6.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir7.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir7.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir7.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir7.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir8.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir8.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir8.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir8.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir9.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir9.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1664/data/souvenir9.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1664/data/souvenir9.out
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user