mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-24 00:48:47 +00:00
parent
477b00bccd
commit
6c3f7d331c
62
S2OJ/714/714.cpp
Normal file
62
S2OJ/714/714.cpp
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
using std::cin;
|
||||||
|
using std::cout;
|
||||||
|
const char endl = '\n';
|
||||||
|
|
||||||
|
long long a, b,
|
||||||
|
f[15], g[15]{1},
|
||||||
|
cnt_a[10], cnt_b[10];
|
||||||
|
|
||||||
|
std::vector<int> gen(long long x) {
|
||||||
|
std::vector<int> res;
|
||||||
|
|
||||||
|
while (x) {
|
||||||
|
res.push_back(x % 10);
|
||||||
|
x /= 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
void calc(long long x, long long* r) {
|
||||||
|
auto num = gen(x);
|
||||||
|
|
||||||
|
for (int i = num.size(); i; i--) {
|
||||||
|
for (int j = 0; j < 10; j++) {
|
||||||
|
r[j] += f[i - 1] * num.at(i - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int j = 0; j < num[i - 1]; j++) {
|
||||||
|
r[j] += g[i - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
x -= g[i - 1] * num[i - 1];
|
||||||
|
r[num[i - 1]] += x + 1;
|
||||||
|
r[0] -= g[i - 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
std::ios::sync_with_stdio(false);
|
||||||
|
cin.tie(nullptr);
|
||||||
|
|
||||||
|
cin >> a >> b;
|
||||||
|
|
||||||
|
for (int i = 1; i <= 12; i++) {
|
||||||
|
f[i] = f[i - 1] * 10 + g[i - 1];
|
||||||
|
g[i] = g[i - 1] * 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
calc(a - 1, cnt_a);
|
||||||
|
calc(b, cnt_b);
|
||||||
|
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
cout << cnt_b[i] - cnt_a[i] << ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
S2OJ/714/data/data1.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data1.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data1.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data10.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data10.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data10.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data2.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data2.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data2.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data3.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data3.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data3.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data4.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data4.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data4.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data5.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data5.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data5.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data6.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data6.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data6.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data6.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data7.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data7.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data7.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data7.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data8.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data8.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data8.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data8.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data9.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data9.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/data9.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/data9.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/714/data/problem.conf
(Stored with Git LFS)
Normal file
BIN
S2OJ/714/data/problem.conf
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user