이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "robots.h"
#include <bits/stdc++.h>
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define all(x) x.begin() , x.end()
#define mm(dp , val) memset (dp , val , sizeof dp)
#define mid ((r+l)>>1)
#define lx (n<<1)
#define rx ((n<<1)|1)
typedef long long ll;
using namespace std;
const int logn = 26 ;
const int N = 1e6+5;
ll n , m , q , x[N] , y[N] , s[N] , w[N] ;
multiset <ll> st ;
vector <ll> vec ;
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
    n = A , m = B , q = T ;
    for (int i = 0 ; i<n ; i++)
    {
        x[i] = X[i] ;
        vec.pb(x[i]) ;
    }
    sort (x , x+n);
    for (int i = 0 ; i<q ; i++)
    {
        w[i] = W[i] ;
        if (x[n-1] <= w[i]) return -1 ;
        st.insert(w[i]);
    }
    sort (all(vec));
    ll ans = 0 ;
    while (!st.empty())
    {
        for (auto i : vec)
        {
            auto it = st.lower_bound(i) ;
            if (it == st.begin())
            {
                if (*it >= i)
                    continue ;
                else
                    st.erase(it);
            }
            else
            {
                it--;
                st.erase(it);
            }
        }
        ans++;
    }
    return ans;
}
| # | 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... |