Codeforces 495A. Digital Counter Problem Solving report

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.