# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
116024 | Meloric | Sure Bet (CEOI17_sure) | C++14 | 149 ms | 3936 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define pb push_back
#define X first
#define Y second
#define pii pair<int, int>
#define float double
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;
Compilation message (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... |