#include <bits/stdc++.h>
#include "coins.h"
using namespace std;
#define ll int
#define vb vector<bool>
#define pb push_back
#define ff(aa, bb, cc) for(ll aa = bb; aa < cc; aa++)
#define vl vector<ll>
#define pll pair<ll, ll>
#define fi first
#define se second
#define ed "\n"
#define all(aaa) aaa.begin(), aaa.end()
#define rall(aaa) aaa.rbegin(), aaa.rend()
ll MOD = 1e9+7;
std::vector<int> coin_flips(std::vector<int> b, int c){
if(c < 2){
vl cur = b;
vl ans;
cout << cur[0] << " " << cur[1] << ed;
if(cur[0] == cur[1]){
if(c == 0){
if(cur[0] == 0){
return {0};
}
return {1};
}
else{
if(cur[0] == 0){
return {1};
}
return {0};
}
}
else{
if(c == 0){
if(cur[0] == 0){
return {1};
}
return {0};
}
else{
if(cur[0] == 0){
return {0};
}
else{
return {1};
}
}
}
}
b[0] = (b[0]+1)%2;
return b;
}
int find_coin(std::vector<int> b) {
cout << b[0] << " " << b[1] << ed;
if(b[0] == b[1]){
if(b[0] == 0){
return 0;
}
else{
return 1;
}
}
else{
if(b[0] == 1){
return 0;
}
else{
return 1;
}
}
return 7;
}
/*
static string run_test() {
int c;
cin >> c;
vector<int> b(64);
for (int i = 0; i < 8; i++) {
string s;
cin >> s;
for (int j = 0; j < 8; j++) {
b[i * 8 + j] = int(s[j] - '0');
}
}
vector<int> flips = coin_flips(b, c);
if ((int)flips.size() == 0) {
return "0 turn overs";
}
for (int i = 0; i < (int)flips.size(); i++) {
if (flips[i] < 0 || flips[i] > 63) {
return "cell number out of range";
}
b[flips[i]] = 1 - b[flips[i]];
}
int coin = find_coin(b);
if (coin != c) {
return "wrong coin";
}
return "ok";
}
int main() {
int tests;
cin >> tests;
for (int t = 1; t <= tests; t++) {
string result = run_test();
cout << "test #" << t << ": " << result << endl;
}
return 0;
}
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |