Jan 14, 2019 at 9:49am Jan 14, 2019 at 9:49am UTC
As the contest is over now, can someone explain the logic of the pizza question?
Jan 14, 2019 at 10:12am Jan 14, 2019 at 10:12am UTC
base angle (i.e.A1 A0 B1 = pi/(2*n+1)
Jan 14, 2019 at 10:13am Jan 14, 2019 at 10:13am UTC
now by using this angle, and properties of isosceles triangle and exterior angle property we can get any angle
Jan 14, 2019 at 10:36am Jan 14, 2019 at 10:36am UTC
@honeybuzz draw figures for n=1,2,3. Apply proprties of triangles, u will get it. If u dont DM me.
Jan 14, 2019 at 1:54pm Jan 14, 2019 at 1:54pm UTC
@honey buzz as blackmamba told draw the figures and apply geometry u should get it.
I will post the code if anyone wants to rectify(those who have solved will understand)
#include<bits/stdc++.h>
using namespace std;
void frac(long frac1,long frac2){
long a = frac1;
long b = frac2;
//Calculate GCD
long c = a % b;
while(c > 0)
{
a = b;
b = c;
c = a % b;
}
long gcd = b;
frac1 /= gcd;
frac2 /= gcd;
cout<<frac1<<" "<<frac2<<endl;
}
int main(){
int q;
long n,t,x,y,z;
cin>>q;
while(q--){
cin>>n>>t>>x>>y>>z;
if(t==3){
if(x<y&&y<z){
frac(2*n+1-x,2*n+1);
}
else if(x>y&&y>z){
frac(2*n+1-x,2*n+1);
}
else if(x>y&&y<z){
frac(x,2*n+1);
}
else if(x<y&&z<y){
frac(x,2*n+1);
}
}
else if(t==2){
if(x<y&&y<z){
frac(2*n-2*y+1,2*n+1);
}
else if(x>y&&y>z){
frac(2*n-2*y+1,2*n+1);
}
}
else if(t==1){
if(x<y&&y<z){
frac(2*n+1-z,2*n+1);
}
else if(x>y&&y>z){
frac(2*n+1-z,2*n+1);
}
else if(x>y&&y<z){
frac(x,2*n+1);
}
else if(x<y&&z<y){
frac(x,2*n+1);
}
}
else if(t==4){
if(x<y&&y<z){
frac(2*n-2*y+1,2*n+1);
}
else if(x>y&&y>z){
frac(2*n-2*y+1,2*n+1);
}
}
}
}
Jan 14, 2019 at 5:34pm Jan 14, 2019 at 5:34pm UTC
logic for challange problem anyone?
i got 43.5 points.
here is my logic.
I used spiral propagation and paired the points which came in the way!!
Can anyone share logic who got more points.
Jan 14, 2019 at 7:11pm Jan 14, 2019 at 7:11pm UTC
Which question are u talking about ? No offence though
Jan 15, 2019 at 8:53am Jan 15, 2019 at 8:53am UTC
No I didn't try that also :(
It would be great if someone gives hints for EARTSEQ