DWITE '07 R4 #1 - Curve-shot

View as PDF

Submit solution

Points: 5
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
DWITE Online Computer Programming Contest, January 2008, Problem 1

In a typical tactical shooting game, trajectory shots are fired from base to target. Given an angle of the aim and power of the shot, we are interested in the distance the projective will travel.

Standard rules of physics apply. Shot is fired from the center of the base, at the initial velocity specified, in meters per second. The angle determines horizontal and vertical components of the velocity and is supplied in degrees. The target is on the same level as the base. Gravity supplies constant downward acceleration of 9.81 meters per second^2. There is no wind, or any friction.

The input will contain five lines, each in angle power format. Angle in degrees, an integer, 0 \le d \le 90. Power in meter per second, an integer, 0 \le p \le 100.

The output will contain five lines, each stating the expected distance, rounded to the nearest integer.

Sample Input

10 100
25 100
40 100
60 100
85 100

Sample Output


Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Problem Resource: DWITE


  • 0
    KevinLu  commented on Oct. 15, 2017, 10:26 p.m.

    WA? Hey, not sure why I'm getting Wrong Answer on this problem.

    Upon further inspection, I am the only one that has submitted a solution to this problem and there is only 1 test case. Perhaps the judge isn't setup for this problem?

    • 3
      kobortor  commented on Oct. 15, 2017, 10:30 p.m.

      The judge is set up fine, your submission is probably just wrong.

      • -1
        KevinLu  commented on Oct. 15, 2017, 10:37 p.m.

        Yes you're correct, I only wrote the code for 1 line instead of 5.