이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "king.h"
#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false);cin.tie(0)
#define fi first
#define se second
#define eb emplace_back
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define pre(a) cout<<fixed;cout.precision(a)
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
const int inf = 1e9;
const ll INF = 1e18;
long long SendInfo(std::vector<int> W, std::vector<int> C) {
int N = W.size();
sort(all(W));
sort(all(C));
int idx = 0;
int ret = 0;
for(int i=0; i<W.size(); i++) {
while(idx < C.size() && C[idx] < W[i]) idx++;
if(C[idx] >= W[i]) ret = W[i];
}
return 0;
}
#include "vassal.h"
#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false);cin.tie(0)
#define fi first
#define se second
#define eb emplace_back
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define pre(a) cout<<fixed;cout.precision(a)
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
const int inf = 1e9;
const ll INF = 1e18;
int w;
set<pii> S;
void Init(long long B, std::vector<int> C){
int N = C.size();
w = B;
for(int i=0; i<C.size(); i++) {
S.insert({C[i], i});
}
}
int Maid(int W){
//if(W > w) return -1;
set<pii>::iterator it = S.lower_bound({W, -1});
if(it == S.end()) return -1;
int ret = it -> se;
S.erase(it);
return ret;
}
컴파일 시 표준 에러 (stderr) 메시지
king.cpp: In function 'long long int SendInfo(std::vector<int>, std::vector<int>)':
king.cpp:27:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0; i<W.size(); i++) {
~^~~~~~~~~
king.cpp:28:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while(idx < C.size() && C[idx] < W[i]) idx++;
~~~~^~~~~~~~~~
king.cpp:21:6: warning: unused variable 'N' [-Wunused-variable]
int N = W.size();
^
king.cpp:26:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
int ret = 0;
^~~
vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:26:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0; i<C.size(); i++) {
~^~~~~~~~~
vassal.cpp:23:6: warning: unused variable 'N' [-Wunused-variable]
int N = C.size();
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |