답안 #865162

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
865162 2023-10-24T06:10:34 Z vjudge1 Sure Bet (CEOI17_sure) C++17
0 / 100
1 ms 348 KB
/*
    Author: AZ1X
    Created:24.10.2023
    Why am I so stupid? :|
    Slishkom slab<
*/

#include<bits/stdc++.h>
// it's solo


#define int		    unsigned long long
#define ld          long double
#define all(x) 		x.begin(), x.end()
#define yes			"YES\n"
#define no			"NO\n"
#define ok			"OK\n"
#define amirrrr			ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pf			push_front
#define pb			push_back
#define S			second
#define F			first
using namespace std;


int mx = (int)1e18 * -1, mn = (int)1e18 * 1;
const int N = 100000;
const int mod = 1e9 + 7;
const int inf = 1e18 - 1;
/*
    I gO To SchooL
    #kbo1_top_5
*/


void legenda_ne_umret() {
    int n;
    cin >> n;
    ld sum = 0.0, summ = 0.0;
    while (n--) {
        ld a, b;
        cin >> a >> b;
        if (a > b) {
            sum += a ;
        }
        else {
            summ += b;
        }
    }
    int a = sum;
    int b = summ;
    sum -= a;
    summ -= b;
    cout <<fixed << setprecision(4) << min(summ, sum);
}

signed main () {
    amirrrr;
//freopen("cities.in", "r", stdin);
//freopen("cities.out", "w", stdout);
/////////////////////////////////////////
    int t = 1;
    //cin >> t;
    for (int i = 1; i <= t; i++) {
        //cout << "Case " << i << ":\n";
        legenda_ne_umret();
    }
//  created by Abdulaziz(tuuf choza kraww?!)
}

# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -