Submission #1135627

#TimeUsernameProblemLanguageResultExecution timeMemory
1135627noodles0428Coins (IOI17_coins)C++20
Compilation error
0 ms0 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 == 2) return vector <int> ();
    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> ();
}

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;
}

#ifndef ONLINE_JUDGE
signed main (){
    ios_base::sync_with_stdio (false);
    cin.tie (NULL);
    cout.tie (NULL);
    vector <int> vec (64, 0);
    vector <int> b = coin_flips (vec, 1);
    for (int i : b) vec[i] ^= 1;
    int res = find_coin (vec);
    cout << res;
}
#endif

// love you, noodles0428 <333
// voi25 3rd++

Compilation message (stderr)

/usr/bin/ld: /tmp/ccZqYiEp.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc2eQy4u.o:coins.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status