| Task: | Mountain Biking |
| Sender: | lazycoder |
| Submission time: | 2015-11-25 17:13:03 +0200 |
| Language: | C++ |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.05 s | details |
| #2 | WRONG ANSWER | 0.06 s | details |
| #3 | ACCEPTED | 0.06 s | details |
| #4 | ACCEPTED | 0.05 s | details |
| #5 | WRONG ANSWER | 0.05 s | details |
| #6 | ACCEPTED | 0.05 s | details |
| #7 | WRONG ANSWER | 0.06 s | details |
| #8 | WRONG ANSWER | 0.06 s | details |
| #9 | WRONG ANSWER | 0.06 s | details |
Code
#include <iostream>
#include <cmath>
#include <cerrno>
#include <cfenv>
using namespace std;
const double pi = std::acos(-1);
int main(int argc, char** argv) {
int N, D, ang, g;
double *H, totH = 0, covH = 0, out;
cin>>N;
cin>>g;
H = new double[N];
for (int i = 0; i < N; i++) {
cin >> D;
cin >> ang;
H[i] = D * std::cos(ang * pi / 180);
totH += H[i];
}
for (int j = 0; j < N; j++) {
out = sqrt(2 * g * (totH - covH));
cout << out << endl;
covH += H[j];
}
cout.flush();
return 0;
}
Test details
Test 1
Verdict: WRONG ANSWER
| input |
|---|
| 4 1 1000 89 1000 88 1000 87 1000 86 |
| correct output |
|---|
| 18.67856167518548 17.71958953754687 15.62641545506002 11.81155990918434 |
| user output |
|---|
| 18.6786 17.7196 15.6264 11.8116 |
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 4 100 994 89 991 84 999 89 773 81 |
| correct output |
|---|
| 227.72535853692241 219.97568165830942 166.34830657806216 155.51452760182793 |
| user output |
|---|
| 227.725 219.976 166.348 155.515 |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 4 1 603 1 11 20 778 2 313 1 |
| correct output |
|---|
| 58.37333588228029 46.92153047021062 46.70071502674894 25.01808660085541 |
| user output |
|---|
| 58.3733 46.9215 46.7007 25.0181 |
Test 4
Verdict: ACCEPTED
| input |
|---|
| 3 100 1000 1 1000 2 998 1 |
| correct output |
|---|
| 774.22044947696459 632.01880142685220 446.73213445331610 |
| user output |
|---|
| 774.22 632.019 446.732 |
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 4 33 600 20 600 40 600 60 600 80 |
| correct output |
|---|
| 306.95871964523821 238.77149700733121 163.32932325706381 82.92447066825597 |
| user output |
|---|
| 306.959 238.771 163.329 82.9245 |
Test 6
Verdict: ACCEPTED
| input |
|---|
| 4 81 627 80 822 60 411 40 801 20 |
| correct output |
|---|
| 507.11074231227801 489.41103887240717 415.86195422299554 349.19392013381482 |
| user output |
|---|
| 507.111 489.411 415.862 349.194 |
Test 7
Verdict: WRONG ANSWER
| input |
|---|
| 1 65.678904776 5999 83 |
| correct output |
|---|
| 309.895033063524 |
| user output |
|---|
| 0 |
Test 8
Verdict: WRONG ANSWER
| input |
|---|
| 3 16.5485760467 9210 5 3641 10 7313 12 |
| correct output |
|---|
| 811.8442666570775 596.1763940359323 486.5699641893223 |
| user output |
|---|
| 0 0 0 |
Test 9
Verdict: WRONG ANSWER
| input |
|---|
| 1 19.5935866382 6927 30 |
| correct output |
|---|
| 484.85276685524383 |
| user output |
|---|
| 0 |
