# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
397080 | Nicholas_Patrick | Sure Bet (CEOI17_sure) | C++17 | 91 ms | 4368 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <queue>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
int n;
scanf("%d", &n);
vector<int> a(n), b(n);
for(int i=n; i--;){
double x, y;
scanf("%lf%lf", &x, &y);
a[i]=x*10000+0.1;
b[i]=y*10000+0.1;
}
sort(a.rbegin(), a.rend());
sort(b.rbegin(), b.rend());
vector<long long> psa(n+1), psb(n+1);
psa[0]=psb[0]=0;
for(int i=0; i<n; i++){
psa[i+1]=psa[i]+a[i];
psb[i+1]=psb[i]+b[i];
}
long long best=0;
for(int i=0; i<=n; i++){
int low=0, high=n, mid;//candy[]
while(low<=high){
mid=low+high>>1;
long long tota=psa[mid]-(mid+i)*10000;
컴파일 시 표준 에러 (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... |