Submission #765804

#TimeUsernameProblemLanguageResultExecution timeMemory
765804fatemetmhrRobots (IOI13_robots)C++17
14 / 100
110 ms15264 KiB
//  ~ Be Name Khoda ~  //
 
#include "robots.h"
#include <bits/stdc++.h>
 
//#pragma GCC optimize ("O3")
//#pragma GCC target("avx2")
//#pragma GCC optimize("unroll-loops,Ofast")
 
using namespace std;
 
typedef long long ll;
 
#define pb       push_back
#define mp       make_pair
#define all(x)   x.begin(), x.end()
#define fi       first
#define se       second
 
const int maxn  =  1e6   + 10;
const int maxn5 =  1e6   + 10;
const int maxnt =  1.2e6 + 10;
const int maxn3 =  1e3   + 10;
const int mod   =  1e9   + 7;
const ll  inf   =  1e18;
 
 
 
int putaway(int a, int b, int T, int x[], int y[], int w[], int s[]) {
    int t = T;
    int n = a; 
    int m = b;
    sort(x, x + a);
    sort(y, y + b);
    for(int i = 0; i < t; i++){
        if((n == 0 || w[i] >= x[n - 1]) && (m == 0 || s[i] >= y[m - 1]))
            return -1;
    }
    if(a && x[0] > w[0]){
        if(b && y[0] > s[1])
            return 1;
        if(a > 1 && x[1] > w[1])
            return 1;
    }
    if(b > 1 && y[0] > s[0] && y[1] > s[1])
        return 1;
    swap(w[0], w[1]);
    swap(s[0], s[1]);
    if(a && x[0] > w[0]){
        if(b && y[0] > s[1])
            return 1;
        if(a > 1 && x[1] > w[1])
            return 1;
    }
    if(b > 1 && y[0] > s[0] && y[1] > s[1])
        return 1;
    return 2;
}
#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...