제출 #993249

#제출 시각아이디문제언어결과실행 시간메모리
993249vjudge1로봇 (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;
    }
}

컴파일 시 표준 에러 (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...