Submission #993249

#TimeUsernameProblemLanguageResultExecution timeMemory
993249vjudge1Robots (IOI13_robots)C++17
14 / 100
80 ms4472 KiB
#include "robots.h"

int putaway(int A, int B, int T, int X[], int Y[], int w[], int s[]) {
    if(A == 2){
        int x = X[0], y = X[1];
        if(x > w[0] && y > w[1]) return 1;
        if(x > w[1] && y > w[0]) return 1;
        if(x > w[1] && x > w[0]) return 2;
        if(y > w[1] && y > w[0]) return 2;
        return -1;
    }
    if(A == 1){
        int x = X[0], y = Y[0];
        if(x > w[0] && y > s[1]) return 1;
        if(x > w[1] && y > s[0]) return 1;
        if(x > w[1] && x > w[0]) return 2;
        if(y > s[1] && y > s[0]) return 2;
        return -1;
    }
    if(B == 2){
        int x = Y[0], y = Y[1];
        if(x > s[0] && y > s[1]) return 1;
        if(x > s[1] && y > s[0]) return 1;
        if(x > s[1] && x > s[0]) return 2;
        if(y > s[1] && y > s[0]) return 2;
        return -1;
    }
}

Compilation message (stderr)

robots.cpp: In function 'int putaway(int, int, int, int*, int*, int*, int*)':
robots.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      | ^
#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...