Submission #1316958

#TimeUsernameProblemLanguageResultExecution timeMemory
1316958spetrMachine (IOI24_machine)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "machine.h"

using namespace std;

#define ll long long
const ll mmod = 998244353;  
#define vl vector<long long>
#define vll vector<vector<long long>>
#define pl pair<long long, long long>
#define vb vector<bool>

std::vector<int> find_permutation(int N){
    vector<int> cisla;
    for (ll i = 0; i < N; i++){
        cisla.push_back(i);
    }

    vector<int> p = use_machine(cisla);
    ll x;
    for (x = 0; x <= 255; x++){
        set<int> px;
        for (ll i = 0; i < N; i++){
            px.insert(p[i]^x);
        }

        bool ok = true;
        for (ll i = 0; i < N; i++){
            auto it = px.find(cisla[i]);
            if (it == px.end()){
                ok = false;
            }
        }

        if (ok){
            break;
        }
    }
    for (ll i = 0; i < N; i++){
        p ^= x;
    }
    return p;

}

Compilation message (stderr)

machine.cpp: In function 'std::vector<int> find_permutation(int)':
machine.cpp:40:11: error: no match for 'operator^=' (operand types are 'std::vector<int>' and 'long long int')
   40 |         p ^= x;
      |         ~~^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:176,
                 from machine.cpp:1:
/usr/include/c++/13/future:182:18: note: candidate: 'std::launch& std::operator^=(launch&, launch)'
  182 |   inline launch& operator^=(launch& __x, launch __y) noexcept
      |                  ^~~~~~~~
/usr/include/c++/13/future:182:37: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::launch&'
  182 |   inline launch& operator^=(launch& __x, launch __y) noexcept
      |                             ~~~~~~~~^~~
In file included from /usr/include/c++/13/format:39,
                 from /usr/include/c++/13/bits/chrono_io.h:39,
                 from /usr/include/c++/13/chrono:3370,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:172:
/usr/include/c++/13/charconv:665:3: note: candidate: 'constexpr std::chars_format& std::operator^=(chars_format&, chars_format)'
  665 |   operator^=(chars_format& __lhs, chars_format __rhs) noexcept
      |   ^~~~~~~~
/usr/include/c++/13/charconv:665:28: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::chars_format&'
  665 |   operator^=(chars_format& __lhs, chars_format __rhs) noexcept
      |              ~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/13/streambuf:43,
                 from /usr/include/c++/13/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/13/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:54:
/usr/include/c++/13/bits/ios_base.h:190:3: note: candidate: 'const std::_Ios_Iostate& std::operator^=(_Ios_Iostate&, _Ios_Iostate)'
  190 |   operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
      |   ^~~~~~~~
/usr/include/c++/13/bits/ios_base.h:190:28: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::_Ios_Iostate&'
  190 |   operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
      |              ~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/ios_base.h:150:3: note: candidate: 'const std::_Ios_Openmode& std::operator^=(_Ios_Openmode&, _Ios_Openmode)'
  150 |   operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
      |   ^~~~~~~~
/usr/include/c++/13/bits/ios_base.h:150:29: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::_Ios_Openmode&'
  150 |   operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
      |              ~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/ios_base.h:107:3: note: candidate: 'const std::_Ios_Fmtflags& std::operator^=(_Ios_Fmtflags&, _Ios_Fmtflags)'
  107 |   operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
      |   ^~~~~~~~
/usr/include/c++/13/bits/ios_base.h:107:29: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::_Ios_Fmtflags&'
  107 |   operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
      |              ~~~~~~~~~~~~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:41:
/usr/include/c++/13/cstddef:177:3: note: candidate: 'constexpr std::byte& std::operator^=(byte&, byte)'
  177 |   operator^=(byte& __l, byte __r) noexcept
      |   ^~~~~~~~
/usr/include/c++/13/cstddef:177:20: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::byte&'
  177 |   operator^=(byte& __l, byte __r) noexcept
      |              ~~~~~~^~~