답안 #149572

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
149572 2019-09-01T06:45:58 Z 요까할 로뭘 은명팀(#3558, mario05092929, foja001, earthk) 십자가 놓기 (FXCUP4_cross) C++17
0 / 100
6 ms 384 KB
#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;

bool cmp(pll p1,pll p2)
{
    if(p1.first == p2.first) return p1.second > p2.second;
    else return p1.first > p2.first;
}

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(),cmp);
	ll oo = 1e10,ii = 1e10,ans = 0;
	for(int i = 0;i < k;i++)
    {
        //ans = max(ans,v[i].first*(2*v[i].second-v[i].first));
        ii = min(ii,v[i].first);
        oo = min(oo,v[i].second);
    }
    return ii*(2*oo-ii);
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Incorrect 6 ms 384 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Incorrect 6 ms 384 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Incorrect 6 ms 384 KB Output isn't correct
5 Halted 0 ms 0 KB -