제출 #1339689

#제출 시각아이디문제언어결과실행 시간메모리
1339689AMel0nCoins (IOI17_coins)C++20
0 / 100
5 ms580 KiB
#include "coins.h"
using namespace std;

vector<int> coin_flips(vector<int> b, int c) {
    int x = 0;
    for(int &i: b) x ^= i;
    return {x ^ c}; // toggle coin x for the xor to be 0, toggle coin x^c for the xor to be c
}

int find_coin(vector<int> b) {
    int x = 0;
    for(int &i: b) x ^= i;
    return x;
}

컴파일 시 표준 에러 (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...