Submission #1308874

#TimeUsernameProblemLanguageResultExecution timeMemory
1308874thnhannCoins (IOI17_coins)C++20
0 / 100
6 ms576 KiB
#include "coins.h"
#include <bits/stdc++.h>

using namespace std;

std::vector<int> coin_flips(std::vector<int> b, int c) {
    std::vector<int> flip(1);
    flip[0] = 4;
    if(c == 0)
    {
        if(b[0] == 1 && b[2] == 1)
            flip[0] = 2;
        if(b[0] == 0 && b[2] == 0)
            flip[0] = 0;
        if(b[0] == 0 && b[2] == 1)
        {
            if(b[1] == 0)
                flip[0] = 1;
        }
    }
    if(c == 1)
    {
        if(b[0] == 1 && b[2] == 1)
        {
            if(b[1] == 0)
                flip[0] = 1;
        }
        if(b[0] == 1 && b[2] == 0)
            flip[0] = 0;
        if(b[0] == 0 && b[2] == 1)
            flip[0] = 2;
    }
    if(c == 2)
    {

        if(b[0] == 1 && b[2] == 1)
            flip[0] = 0;
        if(b[0] == 0 && b[2] == 0)
            flip[0] = 2;
        if(b[0] == 1 && b[2] == 0)
        {
            if(b[1] == 0)
                flip[0] = 1;
        }

    }
    return flip;
}

int find_coin(std::vector<int> b) {
    int c;
    if(b[0] == 1 && b[2] == 0 && b[1] == 0) return 0;
    if(b[0] == 1 && b[2] == 0 && b[1] == 1) return 2;

    if(b[0] == 0 && b[2] == 1 && b[1] == 0) return 2;
    if(b[0] == 0 && b[2] == 1 && b[1] == 1) return 0;
    return 1;
}

Compilation message (stderr)

grader.cpp: In function 'void shuffle(std::vector<int>&)':
grader.cpp:88:23: warning: 'void std::random_shuffle(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]' is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations]
   88 |         random_shuffle(v.begin(), v.end());
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61,
                 from grader.cpp:5:
/usr/include/c++/13/bits/stl_algo.h:4581:5: note: declared here
 4581 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~
#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...