CCC '04 J3 - Smile with Similes

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
Canadian Computing Competition: 2004 Stage 1, Junior #3

A simile is a combination of an adjective and noun that produces a phrase such as "Easy as pie" or "Cold as ice".

Write a program to input n adjectives (1 \le n \le 5) and m nouns (1 \le m \le 5), and print out all possible similes. The first two lines of input will provide the values of n and m, in that order followed, one per line, by n adjectives and m nouns.

Your program may output the similes in any order.

Sample Input

3
2
Easy
Smart
Soft
pie
rock

Sample Output

Easy as pie
Easy as rock
Smart as pie
Smart as rock
Soft as pie
Soft as rock

CCC problem statements in large part from the PEG OJ


Comments


  • 5
    tianzey  commented on Sept. 5, 2020, 11:04 a.m. edited

    hi i made it


  • -8
    KevinYangJ8  commented on April 17, 2020, 6:46 p.m. edited

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


  • 3
    TimothyW553  commented on Dec. 26, 2017, 12:55 a.m.

    How come you guys don't have all the J3 problems?


    • -8
      tianzey  commented on Aug. 22, 2020, 10:58 a.m.

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


    • 5
      wleung_bvg  commented on Dec. 26, 2017, 4:29 p.m.

      Some problems are shared between junior and senior. J3 is sometimes (but not always) the same problem as S1 and is listed as S1 on this site.


      • -10
        felixzhang25  commented on May 26, 2018, 7:50 p.m.

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


  • 31
    bobhob314  commented on April 20, 2015, 8:14 p.m. edit 3

    Similes is missplet.

    MOD EDIT: Fixed.

    HOB EDIT: Thanks.


    • 3
      1jiangand2  commented on July 22, 2020, 7:38 p.m.

      misspelt is misspelt