Submission #1135635

#TimeUsernameProblemLanguageResultExecution timeMemory
1135635noodles0428Coins (IOI17_coins)C++20
10 / 100
5 ms584 KiB
#ifdef ONLINE_JUDGE
#include "coins.h"
#endif

#include <bits/stdc++.h>
using namespace std;

#define pp pair <int, int>
#define fi first
#define se second
#define yes cout << "YES\n"
#define no cout << "NO\n"

vector <int> coin_flips (vector <int> b, int c){
    /*int state[2] = {(c == 0), (c == 1)};
    int match = (state[0] == b[0]) + (state[1] == b[1]);
    if (match == 1){
        vector <int> vec;
        if (state[0] != b[0]) vec.push_back (0);
        if (state[1] != b[1]) vec.push_back (1);
        return vec;
    }
    if (c == 0){
        vector <int> vec;
        if (b[0]) vec.push_back (0);
        if (b[1]) vec.push_back (1);
        return vec;
    }
    if (c == 1){
        vector <int> vec;
        if (b[0] == 0) vec.push_back (0);
        if (b[1] == 0) vec.push_back (1);
        return vec;
    }
    return vector <int> ();*/
    vector <int> vec;
    for (int i = 0; i < 64; i++){
        if (i == c){
            if (b[i] == 0) vec.push_back (i);
        } else {
            if (b[i] == 1) vec.push_back (i);
        }
    }
    if (vec.empty ()){
        vec.push_back (0); vec.push_back (0);
    }
    return vec;
}

int find_coin (vector <int> b){
    /*if (b[0] == 0 && b[1] == 0) return 0;
    if (b[0] && b[1]) return 1;
    if (b[0]) return 0;
    return 1;*/
    for (int i = 0; i < 64; i++) if (b[i] == 1) return i;
    return 0;
}

// love you, noodles0428 <333
// tst25
#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...