# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
150241 | 요까할 로뭘 은명팀 (#200) | 십자가 놓기 (FXCUP4_cross) | C++17 | 229 ms | 16092 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cross.h"
#include <bits/stdc++.h>
#define pll pair<long long,long long>
using namespace std;
typedef long long ll;
vector <pll> v;
int n;
int a[200005];
multiset <int> s;
bool cmp(pll p1,pll p2)
{
if(p1.first == p2.first) return p1.second > p2.second;
else return p1.first > p2.first;
}
bool cmp2(pll p1,pll p2)
{
if(p1.second == p2.second) return p1.first > p2.first;
else return p1.second > p2.second;
}
long long SelectCross(int k,vector<int> I,vector<int> O) {
n = I.size();
for(int i = 0;i < n;i++) v.push_back(make_pair((ll)I[i],(ll)O[i]));
sort(v.begin(),v.end());
ll oo = 1e10,ii = 1e10,ans = 0;
for(int i = n-k;i < n;i++) s.insert(v[i].second);
auto it = s.begin();
ans = v[n-k].first*(2*(*it)-v[n-k].first);
//cout << ans << " " << *it << " " << v[n-k].first << '\n';
for(int i = n-k-1;i >= 0;i--)
{
s.insert(v[i].second);
it = s.begin(); s.erase(it);
it = s.begin();
ans = max(ans,v[i].first*(2*(*it)-v[i].first));
//cout << ans << " ";
}
//return ii*(2*oo-ii);
return ans;
}
컴파일 시 표준 에러 (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... |