제출 #993388

#제출 시각아이디문제언어결과실행 시간메모리
993388vjudge1로봇 (IOI13_robots)C++17
0 / 100
1 ms604 KiB
#include "robots.h"
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
//#define f first
//#define s second
using namespace std;



int putaway(int a , int b , int t , int x[] , int y[] , int w[] , int cc[])
{
//    a = 3;
//    x[0] = 1;
//    x[1] = 2;
//    x[2] = 3;
//    t = 3;
//    w[0] = 0;
//    w[1] = 1;
//    w[2] = 2;
    //cout << x[2] << endl;
    sort(x , x + a);
    multiset<int> s;
    for (int i=0; t>i; i++)
    {
        s.insert(w[i]);
    }
    bool f = 0;
    int st = 0 , ans = 0;
    while (!s.empty())
    {
        for (int i=st; a>i; i++)
        {
            auto z = s.lower_bound(x[i]);
            if (z == s.begin())
            {
                st = i + 1;
                continue;
            }
            s.erase(z);

        }
        ans++;
        if (st > a)
        {
            ans = -1;
            break;
        }
    }
    return ans;
}

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

robots.cpp: In function 'int putaway(int, int, int, int*, int*, int*, int*)':
robots.cpp:28:10: warning: unused variable 'f' [-Wunused-variable]
   28 |     bool f = 0;
      |          ^
#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...