| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 116023 | Meloric | Sure Bet (CEOI17_sure) | C++14 | 2 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
#define X first
#define Y second
#define pii pair<int, int>
using namespace std;
vector<float> A, B;
int main(){
int n; cin >> n;
for(int i = 0; i< n; i++){
float c, d; cin >> c >> d;
if(c>1)A.pb(c);
if(d>1)B.pb(d);
}
sort(A.begin(), A.end());
sort(B.begin(), B.end());
reverse(A.begin(), A.end());
reverse(B.begin(), B.end());
int p1 = 0;
int p2 = 0;
float v1 = 0;
float v2 = 0;
float ans = 0;
while(1){
if(v1 < v2){
if(p1 == A.size())break;
v1+=A[p1]-1;
v2-=1;
p1++;
}else{
if(p2 == B.size())break;
v1-=1;
v2+=B[p2]-1;
p2++;
}
ans = max(ans, min(v1, v2));
}
printf("%.4lf", (double)ans);
return 0;
}컴파일 시 표준 에러 (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... | ||||
