# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1014566 | Error404 | Kitchen (BOI19_kitchen) | C++17 | 1 ms | 3420 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define f first
#define s second
#define pi pair<ll,ll>
#define vi vector<ll>
#define vd vector<double>
#define vpi vector<pi>
#define pb push_back
#define INF 1e18
#define endl '\n'
//#define int ll
#define pii pair<pi,ll>
const int mod = 1e9+7;
const int MAX = 1e5+1;
const int LOG = 30;
vi g[MAX];
int tin[MAX], val[MAX], tout[MAX];
int up[LOG+1][MAX];
map<pi,int>mp;
vector<pi>order;
int timer = 0;
signed main(){
int n,m,k,a,b;
cin >>n >> m >> k;
int dish[n+1], chef[m+1];
int mx = 0;
for(int i= 1; i<= n; i++){
cin >> dish[i];
mx = max(dish[i],mx);
}
multiset<int>st;
for(int i = 1; i <=m; i++){
cin >> chef[i];
st.insert(chef[i]);
}
ll ans = 0;
bool flag = false;
auto j = st.lower_bound(mx);
if(j==st.end()) {
cout << "Impossible"<<endl;
return 0;
}
for(int i = n; i >=1; i--){
ans += (*j)-dish[i];
// cout << (*j)<<" "<< dish[i]<<endl;
// st.erase(j);
}
cout << ans << endl;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |