이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "king.h"
#include<map>
#include<vector>
#include<algorithm>
#include<iostream>
#define ll long long
#define rep(i,a,b) for(int i = a;i < b;i++)
#define MAXN 300003
long long SendInfo(std::vector<int> W, std::vector<int> C) {
int n = W.size();
int cur = 0;
int first= 0;
sort(W.rbegin(),W.rend());
sort(C.rbegin(),C.rend());
rep(i,0,n)
{
if(W[i] <= C[cur])
{
first = W[i];
cur++;
}
}
if(cur==0)
return 0;
return W[n-cur];
}
#include "vassal.h"
#include<map>
#include<vector>
#include<iostream>
#include<set>
#define ll long long
#define pi pair < ll,ll >
#define mp(a,b) make_pair(a,b)
#define rep(i,a,b) for(int i = a;i < b;i++)
#define MAXN 1000003
using namespace std;
long long maxi;
ll seg[4*MAXN];
set < pi > available;
/*
void update(ll low,ll high,ll pos,ll slow)
{
if(low == high && low == slow)
{
seg[pos]++;
return;
}
if(low > slow || high < slow)
return;
ll mid = (low+high)/2;
update(low,mid,pos*2+1,slow);
update(mid+1,high,pos*2+2,slow);
return;
}
ll query(ll low,ll high,ll pos,ll slow)
{
if(low >= slow)
{
}
if(high < slow)
return 0;
ll mid = (low+high)/2;
}
*/
void Init(long long B, std::vector<int> C){
int n = C.size();
maxi = B;
rep(i,0,n)
{
available.insert(mp(C[i],i));
}
return;
}
int Maid(int W){
if(W>maxi)
return -1;
else
{
set < pi >::iterator it = available.lower_bound(mp(W,0));
return (*it).second;
}
}
컴파일 시 표준 에러 (stderr) 메시지
king.cpp: In function 'long long int SendInfo(std::vector<int>, std::vector<int>)':
king.cpp:13:9: warning: variable 'first' set but not used [-Wunused-but-set-variable]
int first= 0;
^~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |