Submission #424857

#TimeUsernameProblemLanguageResultExecution timeMemory
424857zoooma13The Collection Game (BOI21_swaps)C++14
Compilation error
0 ms0 KiB
#include "swaps.h"
using namespace std;

void solve(int N, int V) {
    vector <int> ord(N);
    iota(ord.begin() ,ord.end() ,1);
    for(int t = 0; t < V; t++){
        for(int i = t&1; i+1 < N; i += 2)
            schedule(ord[i] ,ord[i+1]);
        auto res = visit();
        for(int j = 0 ,i = t&1; i+1 < N; i += 2 ,j++)
            if(!res[j])
                swap(ord[i] ,ord[i+1]);
    }
    answer(ord);
}

Compilation message (stderr)

swaps.cpp: In function 'void solve(int, int)':
swaps.cpp:6:5: error: 'iota' was not declared in this scope
    6 |     iota(ord.begin() ,ord.end() ,1);
      |     ^~~~