제출 #44519

#제출 시각아이디문제언어결과실행 시간메모리
44519MatheusLealVCoins (IOI17_coins)C++17
0 / 100
5 ms1264 KiB
#include <bits/stdc++.h> using namespace std; vector<int> v; vector<int> coin_flips(vector<int> a, int x) { int ini = 0, fim = 63, mid; vector<int> trocados; for(int k = 0; k < 8; k++) { mid = (ini + fim)/2; if( x >= mid) { if(!a[mid]) trocados.push_back(mid); a[mid] = 1; ini = mid + 1; } else { if(a[mid]) trocados.push_back(mid); a[mid] = 0; fim = mid - 1; } } return trocados; } int find_coin(vector<int> a) { int ini = 0, fim = 63, mid; for(int k = 0; k < 20; k++) { mid = (ini + fim)/2; if(a[mid]) ini = mid + 1; else fim = mid - 1; } return mid; }
#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...