Codeforces-Round-640-Div-4

菜鸡的$div4$补题现场……

(真就尼玛见证历史)……

A:Sum of Round Numbers

1.题目描述:

给你一个$n$,拆成$round$数。

$round$数:除最高位以外的其他位所有数字都是0,则成为$round$数。

$1$~$9$所有的数字都是$round$。

input:

1
2
3
4
5
6
5
5009
7
9876
10000
10

output:

1
2
3
4
5
6
7
8
9
10
2
5000 9
1
7
4
800 70 6 9000
1
10000
1
10

2.思路

类似于拆分一个整数$n$, 我们对其每一位判断然后乘上该位置的对应的$10$的倍数即可。

[比赛中 没有看到这一句话]……

$The \ terms\ can\ be \ printed \ in \ any \ order.$

补题的时候我尼玛人都傻了 可以以任何顺序输出…..fuck

我们就可以随便搞了 用一个$a$数组来记录$answer$,然后做整数的取位处理即可。

技巧

对于$\%$运算,取最后一位

对于$/$运算,取除当前位的其他所有位…..

(小声:这TM不就是常识…做题太少……)

3.代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Copyright(c)
* Author : tiketiskte
*/
#include <bits/stdc++.h>
#define IOS {ios::sync_with_stdio(false);cin.tie(0);}
#define ll long long
#define SZ(X) (int)X.size()
#define INF 0x3f3f3f3f

using namespace std;

int t, n, cnt;
int a[6];//保存答案
int main()
{
IOS
cin >> t;
while(t--) {
cnt = 0;
int d = 1;
cin >> n;
while(n) {
if(n % 10) {
a[cnt++] = n % 10 * d;
}
d *= 10;
n /= 10;
}
cout << cnt << endl;
for(int i = 0; i < cnt; i++) {
cout << a[i] << " ";
}
cout << endl;
/* while(n) {
cout << "###" << n % 10 << endl;
cout << "$$$" << n / 10 << endl;
n /= 10;
cout << "The answer about n:" << n << endl;
} */
}
system("pause");
return 0;
}

B:Same Parity Summands

1.题目描述

input:

1
2


output:

1
2


2.思路:

3.代码:

1
2


C:

1.题目描述

input:

1
2


output:

1
2


2.思路:

3.代码:

1
2


D:

1.题目描述:

input:

1
2


output:

1
2


2.思路

3.代码:

1
2