Submission #829600

#TimeUsernameProblemLanguageResultExecution timeMemory
829600vqpahmadCoins (IOI17_coins)C++14
0 / 100
6 ms1332 KiB
#include "coins.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int,int> #define F first #define S second #define endl '\n' #define pb push_back #define sz(a) (int)a.size() #define all(a) a.begin(),a.end() const int mod = 1e9 + 7; const int N = 1e6 + 15; const ll inf = 1e18; vector<int> coin_flips(vector<int> b, int c) { vector<int> flips(1); int n = 64; int val = 0; for (int i=0;i<n;i++){ if (b[i]) val += i; } val %= n; int ans =0; if (c > val){ if (!b[c-val]) ans = c-val; else if (b[val-c+64]) ans = val-c+64; } else { if (b[val-c]) ans = val-c; else if (!b[64-(val-c)]) ans = 64-(val-c); } flips[0] = ans; return flips; } int find_coin(vector<int> b) { int ans = 0; for (int i=0;i<64;i++){ if (b[i]) ans ^= i; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...