# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1170802 | Nelt | Sure Bet (CEOI17_sure) | C++20 | 0 ms | 320 KiB |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define endl "\n"
using namespace std;
using namespace __gnu_pbds;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T, typename key = less<T>>
using ordered_set = tree<T, null_type, key, rb_tree_tag, tree_order_statistics_node_update>;
void solve()
{
ll n;
cin >> n;
long double a[n], b[n];
for (ll i = 0; i < n; i++) cin >> a[i] >> b[i];
long double ans = 0;
ll pw3 = 1;
for (ll i = 1; i <= n; i++) pw3 *= 3;
for (ll msk = 0; msk < pw3; msk++)
{
long double resa = 0, resb = 0;
ll pw = msk, cnt = 0;
for (ll i = 0; i < n; i++)
{
if (pw % 3 == 1) resa += a[i], cnt++;
else if (pw % 3 == 2) resb += b[i], cnt++;
pw /= 3;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |