CCC '18 J1 - Telemarketer or not?

View as PDF

Submit solution

Points: 3
Time limit: 3.0s
Memory limit: 256M

Problem type
Canadian Computing Competition: 2018 Stage 1, Junior #1

Here at the Concerned Citizens of Commerce (CCC), we have noted that telemarketers like to use seven-digit phone numbers where the last four digits have three properties. Looking just at the last four digits, these properties are:

  • the first of these four digits is an 8 or 9;
  • the last digit is an 8 or 9;
  • the second and third digits are the same.

For example, if the last four digits of the telephone number are 8229, 8338, or 9008, these are telemarketer numbers.

Write a program to decide if a telephone number is a telemarketer number or not, based on the last four digits. If the number is not a telemarketer number, we should answer the phone, and otherwise, we should ignore it.

Input Specification

The input will be a 4 lines where each line contains exactly one digit in the range from 0 to 9.

Output Specification

Output either ignore if the number matches the pattern for a telemarketer number; otherwise, output answer.

Sample Input 1

9
6
6
8

Sample Output 1

ignore

Explanation for Sample Output 1

The first digit is 9, the last digit is 8, and the second and third digit are both 6, so this is a telemarketer number.

Sample Input 2

5
6
6
8

Sample Output 2

answer

Explanation for Sample Output 2

The first digit is 5, and so this is not a telemarketer number.


Comments


  • 0
    Crumpet  commented on Nov. 1, 2019, 10:25 p.m.

    Bruh it no work


  • 0
    official_james  commented on Nov. 1, 2019, 10:07 p.m.

    yah yeet


  • -3
    sku81da  commented on Oct. 6, 2019, 4:45 a.m.

    emmmmmm


  • 8
    Joethenerd  commented on Feb. 20, 2019, 10:04 a.m.

    Man spelling counts! Couldn't get this 3 pointer cause I wrote ingore instead of ignore. And i dint realize for the longest time.


  • -11
    CoolNoobyBooby  commented on Aug. 23, 2018, 10:10 a.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


    • 17
      jjjding2  commented on Sept. 20, 2018, 9:26 a.m.

      ... when you can solve 40 pointers and have 473 points but get stuck for a month on a J1 :thonk:


      • 5
        JimmyDeng12345  commented on Sept. 20, 2018, 11:08 a.m.

        LOL


        • 3
          AlanL  commented on Sept. 27, 2018, 7:08 p.m.

          His 40 point questions are gone now though.... Idk if the 20 point questions are legit or not.


          • 6
            Rimuru  commented on Sept. 27, 2018, 8:32 p.m.

            He was :hammered: from DMOJ :poggers:


    • 2
      Rimuru  commented on Aug. 23, 2018, 9:06 p.m.

      You should test some other cases which can break your code.

      For example:

      9
      5
      4
      9

      This breaks your code. (9 is correct, but when you check for b==c and they don't equal, you don't output anything).


  • 4
    1DontKnowHowIGotHere  commented on April 30, 2018, 12:24 p.m.

    Misread a part of the question.


  • 2
    1DontKnowHowIGotHere  commented on April 27, 2018, 8:33 p.m. edited

    I think there is a problem with this problem, the inputs should be switched.


    • 4
      CoolNoobyBooby  commented on Aug. 22, 2018, 4:35 p.m.

      Note that:

      ignore is when the first and last digits are either 8 or 9 and the two of the middle are the same, not answer

      That may be the problem


    • 1
      Laurak121  commented on July 28, 2018, 7:45 a.m.

      Agree. I'm getting confused.


    • 2
      TimothyW553  commented on April 28, 2018, 9:47 p.m.

      Also, you should probably read the question again because your if statements are wrong


    • 21
      Roynaruto  commented on April 28, 2018, 4:51 p.m.

      Considering that:

      1. This was a CCC contest question, so the test datas were checked over
      2. There are 300 correct submissions on DMOJ

      Perhaps you should check over your code.


      • -36
        TimothyW553  commented on April 28, 2018, 9:43 p.m.

        This comment is hidden due to too much negative feedback. Click here to view it.