Submission #657373

#TimeUsernameProblemLanguageResultExecution timeMemory
657373TrumlingRobots (IOI13_robots)C++14
0 / 100
115 ms4376 KiB
#include "robots.h"
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
#define pb push_back
#define F first
#define S second
#define enter cout<<'\n';
 

int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) 
{
ll a,b;
a=W[0];
b=W[1];
if(a>b)
swap(a,b);
if(A==2)
{
ll x,y;
x=X[0];
y=X[1];

if(x>y)
swap(x,y);

if(y<=b)
return -1;

if(x>a)
return 1;

return 2;
}

a=S[0];
b=S[1];
if(a>b)
swap(a,b);

if(B==2)
{
ll x,y;
x=Y[0];
y=Y[1];

if(x>y)
swap(x,y);

if(y<=b)
return -1;

if(x>a)
return 1;

return 2;
}

a=S[0];
b=S[1];
ll x=W[1],y=W[0];


if(x>y)
swap(x,y);

if(a>b)
swap(a,b);

ll w,s;
w=X[0];
s=Y[0];

ll n1=0,n2=0;
if(w>y)
n1=2;
else if(w>x)
n1=1;

if(s>b)
n2=2;
else if(s>a)
n2=1;

if((n1==2 && n2>=1)||(n2==2 && n1>=1))
return 1;

if(n1==2 || n2==2)
return 2;

if(n1==0 || n2==0)
return -1;

if((X[0]<y && Y[0]<b) || (X[1]<y && Y[1]<b))
return -1;

return 1;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...