이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "king.h"
#include <bits/stdc++.h>
using namespace std;
long long SendInfo(vector<int> w,vector<int> c)
{
sort(w.begin(),w.end());
multiset<int> s;
for (int i:c)
s.insert(i);
int cur=0;
for (int i:w)
{
auto it=s.lower_bound(i);
if (it==s.end())
break;
cur=max(cur,i);
s.erase(it);
}
return cur;
}
#include "vassal.h"
#include <bits/stdc++.h>
using namespace std;
long long mx;
set<pair<int,int> > ch;
void Init(long long b,vector<int> c)
{
for (int i=0;i<c.size();i++)
ch.insert({c[i],i});
mx=b;
}
int Maid(int w)
{
if (w>mx)
return -1;
auto it=ch.lower_bound({w,0});
if (it==ch.end())
return -1;
int ret=it->second;
ch.erase(it);
return ret;
}
컴파일 시 표준 에러 (stderr) 메시지
vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:8:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i=0;i<c.size();i++)
~^~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |