CCC '03 J1 - Trident

View as PDF

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: 2003 Stage 1, Junior #1

A trident is a fork with three tines (prongs). A simple picture of a trident can be made from asterisks and spaces:

*  *  *
*  *  *
*  *  *
*******
*
*
*
*

In this example, each tine is a vertical column of 3 asterisks. Each tine is separated by 2 spaces. The handle is a vertical column of 4 asterisks below the middle tine.

Tridents of various shapes can be drawn by varying three parameters: , the height of the tines, , the spacing between tines, and , the length of the handle. For the example above we have , , and .

You are to write an interactive program to print a trident. Your program should accept as input the parameters , , and , and print the appropriate trident. You can assume that , , are each at least 0 and not larger than 10.

Sample Input

4
3
2

Sample Output

*   *   *
*   *   *
*   *   *
*   *   *
*********
*
*

• commented on July 14, 2020, 11:31 p.m.

I sat staring at my screen trying to figure out how to do it

• commented on July 3, 2020, 4:55 p.m.

Wait I'm confused what's wrong with mine? Pls halp, I'm stoopid

• commented on July 3, 2020, 5:11 p.m. edit 5

For test case #1 and #2, you have a presentation error when submitting, meaning you're outputting excess spaces after the final tine asterisk (e.g., * * * \n, which should be * * *\n); this could be remedied by printing a new line after all of your asterisks on a line are printed.

For the other three test cases, you are getting WAs (wrong answers): you are printing tines with spaces between them, instead of 3 tines with spaces between them (this should be fixed first).

• commented on July 3, 2020, 5:44 p.m.

Thanks, I'm fixing it! :)

• commented on Nov. 2, 2018, 1:19 a.m.

is this really j1 with a 49.2% success rate?1

• commented on Nov. 2, 2018, 2:59 p.m.

A Low AC Rate doesn't necessarily have to mean anything

• commented on Oct. 4, 2018, 8:24 p.m.

my code works in eclipse but not in DM:OJ? I'm pretty sure all the spacing is right

• commented on Nov. 2, 2018, 1:20 a.m.

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

• commented on July 29, 2018, 6:50 p.m.

Its not that bad, just organize your code :) Did it in a couple min

• commented on Jan. 27, 2016, 2:07 p.m.

This one is very challenging!

• commented on July 15, 2018, 7:10 p.m.

This question should worth more than 3 points

• commented on Sept. 24, 2017, 2:39 p.m.

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

• commented on Jan. 27, 2016, 2:51 p.m.

yea, it is!!!

• commented on Jan. 30, 2018, 8:25 p.m.

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

• commented on July 21, 2020, 8:04 p.m. edited

Welcome to episode 534 of "Downvoted for seemingly no reason!"