# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
865108 |
2023-10-24T05:36:35 Z |
vjudge1 |
Sure Bet (CEOI17_sure) |
C++17 |
|
1 ms |
2396 KB |
/*
(( `'-""``""-'` ))
)-__-_.._-__-(
/ --- (o _ o) --- \
\ .-* ( .0. ) *-. /
_'-. ,_ '=' _, .-'_
/ `;#'#'# - #'#'#;` \
\_)) -----'#'----- ((_/
# --------- #
'# ------- #'
/..-'# ------- #'-.\
_\...-\'# -- #'/-.../_
((____)- '#' -(____))
art by - Vinni01 / luchi abi
cout << fixed << setprecision(6) << x;
freopen ( "sum.in", "r", stdin )
*/
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <fstream>
#include <unordered_map>
using namespace std ;
#define ll int
#define ld double
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define UseOFF ios_base::sync_with_stdio(0);cin.tie(0), cout.tie(0)
#define sz size
#define ins insert
#define new jweijofdg
const ll N = 1e5 + 111 ;
const ll k = 400 ;
ld a[ N ], b[ N ] ;
ld p[ N ], s[ N ] ;
ld ans = 0.00 ;
void pp( ll n, ld fir, ld sec, ll sz )
{
if( n == 0 )
{
//if( fir == 3.5 ) cout << fir << " " << sec << " " << sz << " " << ans << '\n' ;
ans = max( ans, ( min( fir, sec ) - sz ) ) ;
return ;
}
pp( n - 1, fir + a[ n ], sec, sz + 1 ) ;
pp( n - 1, fir, sec + b[ n ], sz + 1 ) ;
pp( n - 1, fir, sec, sz ) ;
}
signed main()
{
UseOFF ;
ll n, m ;
cin >> n ;
for( int i = 1 ; i <= n ; i++ )
{
cin >> a[ i ] >> b[ i ] ;
}
/* sort( a + 1, a + n + 1 ) ;
sort( b + 1, b + n + 1 ) ;
reverse( a + 1, a + n + 1 ) ;
reverse( b + 1, b + n + 1 ) ;
vector < ll > v ;
for( int i = 1 ; i <= n ; i++ )
{
p[ i ] = a[ i ] + p[ i - 1 ] ;
s[ i ] = b[ i ] + s[ i - 1 ] ;
}
for( int i = 1 ; i <= n ; i++ )
{
} */
pp( n, 0, 0, 0 ) ;
printf("%.4lf",(double)ans);
}
Compilation message
sure.cpp:21: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
21 | #pragma GCC optimization("unroll-loops")
|
sure.cpp: In function 'int main()':
sure.cpp:79:11: warning: unused variable 'm' [-Wunused-variable]
79 | ll n, m ;
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Incorrect |
0 ms |
2396 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Incorrect |
0 ms |
2396 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Incorrect |
0 ms |
2396 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |