# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
155387 | arnold518 | 로봇 (IOI13_robots) | C++14 | 255 ms | 17016 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "robots.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 5e4;
const int MAXT = 1e6;
int A, B, T, *X, *Y, *W, *S;
pii toy[MAXT+10];
int cnt[MAXN+10];
bool decide(int x)
{
int i, j;
ll left=0;
for(i=A; i>=1; i--)
{
if(cnt[i]>x+left) return false;
left=x+left-cnt[i];
}
return true;
}
int putaway(int _A, int _B, int _T, int *_X, int *_Y, int *_W, int *_S)
{
int i, j;
A=_A; B=_B; T=_T; X=_X; Y=_Y; W=_W; S=_S;
for(i=1; i<=T; i++) toy[i]={W[i-1], S[i-1]};
for(i=A; i>=1; i--) X[i]=X[i-1];
for(i=B; i>=1; i--) Y[i]=Y[i-1];
sort(toy+1, toy+T+1);
sort(X+1, X+A+1);
sort(Y+1, Y+B+1);
int it=1;
for(i=1; i<=T; i++)
{
while(X[it]<=toy[i].first) it++;
cnt[it]++;
}
int lo=0, hi=1e6;
while(lo+1<hi)
{
int mid=lo+hi>>1;
if(decide(mid)) hi=mid;
else lo=mid;
}
if(hi==1e6) return -1;
return hi;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |