제출 #29918

#제출 시각아이디문제언어결과실행 시간메모리
29918kavun로봇 (IOI13_robots)C++14
0 / 100
0 ms6320 KiB
#include "robots.h" #include <bits/stdc++.h> using namespace std; int maxsize, maxweight, minweight = 1e9, minsize = 1e9; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { for(int i = 0; i < A; i++) maxweight = max(maxweight,X[i]); for(int i = 0; i < B; i++) maxsize = max(maxsize,Y[i]); for(int i = 0; i < T; i++) minweight = min(minweight,W[i]), minsize = min(minsize,S[i]); for(int i = 0; i < T; i++) if(W[i] > maxweight && S[i] > maxsize) return -1; if(T == 2 && A+B == 2) { if(A == 2 && B == 0) { sort(X,X+2); if(X[0] < minweight) return 2; else return 1; } else if(A == 1 && B == 1) { return 1; } else { sort(Y,Y+2); if(Y[0] < minsize) return 2; else return 1; } } }

컴파일 시 표준 에러 (stderr) 메시지

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