Submission #1123053

#TimeUsernameProblemLanguageResultExecution timeMemory
1123053SulAGondola (IOI14_gondola)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
//#pragma GCC target("popcnt")
using namespace __gnu_pbds;
using namespace std;
using ordered_set = tree<int, null_type, less_equal<>, rb_tree_tag, tree_order_statistics_node_update>;
#define popcount __builtin_popcountll
#define all(a) (a).begin(), (a).end()

int valid(int n, vector<int> a) {
    deque<int> s;
    int val = -1;
    for (int i = 0; i < n; i++) {
        s.push_back(--a[i]);
        if (a[i] < n) val = i;
    }
    if (val == -1) return true;
    while (s[val] != val) {
        s.push_front(s.back());
        s.pop_back();
    }
    for (int i = 0; i < n; i++) if (s[i] < n && s[i] != i) return 0;
    return 1;
}

//signed main() {
//    ios::sync_with_stdio(false);
//    cin.tie(nullptr);
//    cout.tie(nullptr);
//
//    int n; cin >> n;
//    vector<int> a(n);
//    for (int& x : a) cin >> x;
//    cout << valid(n, a);
//}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccsqVUDO.o: in function `main':
grader.cpp:(.text.startup+0xae): undefined reference to `valid'
/usr/bin/ld: grader.cpp:(.text.startup+0x108): undefined reference to `countReplacement'
/usr/bin/ld: grader.cpp:(.text.startup+0x135): undefined reference to `replacement'
collect2: error: ld returned 1 exit status