Submission #999465

#TimeUsernameProblemLanguageResultExecution timeMemory
999465jcelinBroken Device (JOI17_broken_device)C++14
0 / 100
1 ms1308 KiB
#include<bits/stdc++.h> #include "Annalib.h" using namespace std; typedef vector<int> vi; typedef long long ll; typedef vector<ll> vll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef pair<ll, ll> pll; typedef vector<pll> vpll; #define PB push_back #define PPB pop_back #define X first #define Y second #define all(x) (x).begin(), (x).end() void Anna(int n, ll x, int k, int* p){ srand(19719); vi pos, del(151, 0); for(int i=0; i<n; i++) pos.PB(i); random_shuffle(all(pos)); for(int i=0; i<n; i++) del[p[i]] = 1; for(int i=0; i<75; i++){ int cr = x % 3; x /= (ll)3; int a = pos[i * 2]; int b = pos[i * 2 + 1]; if(cr == 0 and !del[b]){ Set(a, 0); Set(a, 1); }else if(cr == 1 and !del[a]){ Set(a, 1); Set(b, 0); }else if(cr == 2 and !del[a] and !del[b]){ Set(a, 1); Set(b, 1); }else{ Set(a, 0); Set(b, 0); } } }
#include<bits/stdc++.h> #include "Brunolib.h" using namespace std; typedef vector<int> vi; typedef long long ll; typedef vector<ll> vll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef pair<ll, ll> pll; typedef vector<pll> vpll; #define PB push_back #define PPB pop_back #define X first #define Y second #define all(x) (x).begin(), (x).end() ll Bruno(int n, int* p){ srand(19719); vi pos, ret; for(int i=0; i<n; i++) pos.PB(i); random_shuffle(all(pos)); for(int i=0; i<75; i++){ int a = pos[i * 2]; int b = pos[i * 2 + 1]; int vl = p[a] * 2 + p[b]; if(vl == 0) continue; ret.PB(vl - 1); } reverse(all(ret)); ll ans = 0; for(auto &x : ret) ans *= 3, ans += x; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...