Title Link: Http://codeforces.com/problemset/problem/495/A
This topic meaning good around ~ ~ Good around ~~~~~, yesterday morning do not understand, night continue to see still, almost want to help XX beast, eventually still stop, try not to rely on people. Today finally think of, Big moved ~_~
Understanding ability needs to be improved ...
One of the sticks of the counter was broken this sentence has a little misleading element, I just started to think that only a stick bad = =, then see this sentence because of some (possibly none) BR Oken sticks. This sentence is true!!! have been cheated, hehe ...
That is, give an n and find all the X. Should have output x, but because some stick bad (of course, it may not be bad, this is still x), then output n. Then it implies that N is less sticks (or equal to x), whereas X is a bit more sticks (or equal) than N.
This time is to test carefully and observant. Pay attention to the 7 sticks that present the numbers.
n x Tot
0 0, 8 2
1 0, 1, 3, 4, 7, 8, 9 7
2 2, 8 2
3 3, 8, 9 3
4 4, 8, 9 3
5 5, 6, 8, 9 4
6 6, 8 2
7 0, 3, 7, 8, 9 5
8 8 1
9 8, 9 2
So there is the S table in the code. The last is the combination of answers based on two digits (number of single digits * 10 digits)
1#include <iostream>2#include <cstdio>3#include <cstdlib>4 using namespacestd;5 6 Const intS[] = {2,7,2,3,3,4,2,5,1,2};7 8 intMain ()9 {Ten Charnum[5]; One while(SCANF ("%s", num)! =EOF) A { - intA = num[0] -'0'; - intb = num[1] -'0'; theprintf"%d\n", S[a] *s[b]); - } - return 0; -}
Codeforces 495A. Digital Counter Problem Solving report