problem with implementing this question of codechef

Pages: 1... 111213
Now that this competition is finally over (collective sigh of relief from non-participants)...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cmath>
using namespace std;


const double EPS = 1.0e-40;


//======================================================================


struct vec{ double x, y, z; };

istream &operator >> ( istream & strm, vec &V ) { return strm >> V.x >> V.y >> V.z; }

double dot( vec &A, vec &B ) { return A.x * B.x + A.y * B.y + A.z * B.z; }

vec operator - ( vec &A, vec &B ) { return { A.x - B.x, A.y - B.y, A.z - B.z }; }


//======================================================================


int main()
{
   istream &in2 = cin;                 // Use this for actual input
   stringstream in(                    // Version for testing
                    "1                                        \n"
                    "3 0 0   -10 -10 0    0 10 0   0 -3  0  3 \n"
                  );

   int T;
   vec P, Q, D, C;
   double R;
   vec PC, PQ;
   double PCdotD, PQdotD, PCdotPQ, Dsq, PQsq, PCsqminusRsq;
   double a, b, c;
   double t;


   in >> T;
   for ( int i = 0; i < T; i++ ) 
   {
      in >> P >> Q >> D >> C >> R;
      PC = C - P;
      PQ = Q - P;
      Dsq = dot( D, D );
      PQsq = dot( PQ, PQ );
      PCsqminusRsq = dot( PC, PC ) - R * R;
      PQdotD  = dot( PQ, D );
      PCdotD  = dot( PC, D );
      PCdotPQ = dot( PC, PQ );

      a = PCsqminusRsq * Dsq - PCdotD * PCdotD;
      b = 2 * ( PCsqminusRsq * PQdotD - PCdotPQ * PCdotD );
      c = PCsqminusRsq * PQsq - PCdotPQ * PCdotPQ;

      if ( abs( a ) < EPS ) t = - c / b;
      else if ( a >  0 )    t = ( -b + sqrt( b * b - 4.0 * a * c ) ) / ( 2.0 * a );
      else                  t = ( -b - sqrt( b * b - 4.0 * a * c ) ) / ( 2.0 * a );

      cout << scientific << setprecision( 12 ) << t << '\n';
   }
}

Hi, all. why his https://www.codechef.com/users/hitman623 rating is 128 but he secured 4th Rank. 1★
@hitman623. his score is 700 in div2. and also one more https://www.codechef.com/users/harshit_narula his rank is 12. but rating sucks. this mean they cought in plag. right ?
following users secured rank under 50 but rating is under 500.
https://www.codechef.com/users/gt18
https://www.codechef.com/users/chamanag
https://www.codechef.com/users/deep2
https://www.codechef.com/users/jam1729
Rank between 50 to 100 but rating is under 500.
https://www.codechef.com/users/fmg_vishal
https://www.codechef.com/users/rhp17
https://www.codechef.com/users/thegamer1907
https://www.codechef.com/users/dante_smit_98
https://www.codechef.com/users/dk30390
https://www.codechef.com/users/huzaifa242
https://www.codechef.com/users/aniket9465
Last edited on
Hi,all
My all answer is marked as wrong in June challenge. does anyone caught in plag? can I gain this again?
How can I convenience codechef to get all AC again which i done in contest.
Hello, @ipg 2016069
what is your codechef handle?
Anyone got plagrised till now?
My codechef handle is ipg_2016069.
For which question you've got plagrised?
Topic archived. No new replies allowed.
Pages: 1... 111213