Submission #592422

#TimeUsernameProblemLanguageResultExecution timeMemory
592422BT21tataRobots (IOI13_robots)C++17
14 / 100
129 ms15704 KiB
#include "robots.h"
#include <bits/stdc++.h>
using namespace std;

vector<int>pos[10];
int putaway(int A, int B, int T, int x[], int y[], int w[], int s[])
{
    for(int i=0; i<T; i++)
    {
        for(int j=0; j<A; j++)
        {
            if(w[i]<x[j]) pos[i].push_back(j);
        }
        for(int j=0; j<B; j++)
        {
            if(s[i]<y[j]) pos[i].push_back(j+A);
        }
    }
    if(pos[0].size()==0 or pos[1].size()==0) return -1;
    int hv1=0, hv0=0;
    for(int i=0; i<T; i++)
    {
        for(int u : pos[i])
        {
            if(u==1) hv1=1;
            else hv0=1;
        }
    }
    if(!hv0 or !hv1) return 2;
    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...