이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
long long SendInfo(std::vector<int> W, std::vector<int> C) {
int N = W.size();
std::multiset<int> CC(C.begin(),C.end());
std::sort(W.begin(),W.end());
std::sort(C.begin(),C.end());
long long t=0;
for(int i=0;i<N;i++) {
auto it=CC.lower_bound(W[i]);
if(it!=CC.end())
{
t++;
CC.erase(it);
}
}
return t;
}
#include <bits/stdc++.h>
long long BB;
int N;
std::set<std::pair<int,int>> S;
std::vector<int> CC;
void Init(long long B, std::vector<int> C){
N = C.size();
BB = B;
CC=C;
std::sort(CC.begin(),CC.end());
for(int i=0;i<N;i++) S.insert({C[i],i});
}
int Maid(int W){
int ret;
auto it=S.lower_bound(std::make_pair(W,-1));
if(BB<N && W>CC[BB] || it==S.end()) return -1;
ret=it->second;
S.erase(it);
return ret;
}
컴파일 시 표준 에러 (stderr) 메시지
vassal.cpp: In function 'int Maid(int)':
vassal.cpp:19:10: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
if(BB<N && W>CC[BB] || it==S.end()) return -1;
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |