QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#161770 | #7110. Kuririn MIRACLE | ucup-team197# | WA | 2ms | 3856kb | C++14 | 2.1kb | 2023-09-03 01:59:38 | 2023-09-03 01:59:39 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> void check_min(T &a, const T &b){ a = (a < b) ? a : b; }
template<class T> void check_max(T &a, const T &b){ a = (a > b) ? a : b; }
#define all(x) (x).begin(), (x).end()
template <class T> int sgn(T x) { return (x > 0) - (x < 0); }
template<class T>
struct Point {
typedef Point P;
T x, y;
explicit Point(T x=0, T y=0) : x(x), y(y) {}
bool operator<(P p) const { return tie(x,y) < tie(p.x,p.y); }
bool operator==(P p) const { return tie(x,y)==tie(p.x,p.y); }
P operator+(P p) const { return P(x+p.x, y+p.y); }
P operator-(P p) const { return P(x-p.x, y-p.y); }
P operator*(T d) const { return P(x*d, y*d); }
P operator/(T d) const { return P(x/d, y/d); }
T dot(P p) const { return x*p.x + y*p.y; }
T cross(P p) const { return x*p.y - y*p.x; }
T cross(P a, P b) const { return (a-*this).cross(b-*this); }
T dist2() const { return x*x + y*y; }
double dist() const { return sqrt((double)dist2()); }
// angle to x-axis in interval [-pi, pi]
double angle() const { return atan2(y, x); }
P unit() const { return *this/dist(); } // makes dist()=1
P perp() const { return P(-y, x); } // rotates +90 degrees
P normal() const { return perp().unit(); }
// returns point rotated 'a' radians ccw around the origin
P rotate(double a) const {
return P(x*cos(a)-y*sin(a),x*sin(a)+y*cos(a)); }
friend ostream& operator<<(ostream& os, P p) {
return os << "(" << p.x << "," << p.y << ")"; }
};
const double PI = acos(-1);
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while(t--){
double v, r, d;
cin >> v >> r >> d;
r /= v;
d /= v;
const double C = 7.621159867804704 / (3.0 / 2.0);
double dist_to_take = C * r;
double ans = dist_to_take;
ans += d - 4 * r;
ans /= 2;
check_min(ans, d);
// if(ans > d - 2 * r){
// ans = d;
// }
cout << fixed << setprecision(12) << ans << "\n";
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3856kb
input:
1 2.00 3 30.0
output:
8.310579933902
result:
ok found '8.3105799', expected '8.3105799', error '0.0000000'
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3736kb
input:
100 8.66 6.05 71.59 8.44 8.67 82.55 4.23 9.68 24.74 6.63 9.95 7.45 1.2 7.27 97.55 2.08 2.94 31.61 8.48 5.56 20.16 7.35 5.55 52.48 1.35 8.15 51.23 3.88 9.02 72.37 7.03 1.97 57.03 1.78 4.44 93.44 5.5 6.11 52.94 1.09 9.64 69.01 1.01 3.54 16.78 1.63 4.55 44.06 5.82 5.51 5.92 5.62 2.93 76.01 4.75 4.43 73...
output:
4.510893656667 5.445515641938 4.160979316024 1.123680241327 43.919675621928 8.362373399254 1.542989342177 3.978115068767 22.236408129039 10.582290550481 4.207619010886 27.595121687838 5.413047684381 36.435162423742 10.200959053475 15.023778609103 1.017182130584 7.044187331712 8.283981629079 5.110258...
result:
wrong answer 1st numbers differ - expected: '4.4578371', found: '4.5108937', error = '0.0119019'