Submission #559571

#TimeUsernameProblemLanguageResultExecution timeMemory
559571nekiHandcrafted Gift (IOI20_gift)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "gift.h" #define ll long long #define vc vector using namespace std; int construct(int n, int r, int a[], int b[], int x[]){ vc<vc<vc<int>>> ques(3, vc<vc<int>> (n)); for(int i=0;i<r;++i) ques[x[i]][b[i]].push_back(a[i]); vc<pair<int, int>> ints; for(int i=0;i<n;++i){ ints.emplace_back(i, i); for(auto q: ques[1][i]){ while(ints.size() and q<ints.back().first) ints.pop_back(); if(ints.size()) ints.emplace_back(ints.back().second+1, i); else ints.emplace_back(0, i); } } int br=1, j=0; for(int i=0;i<n;++i){ while(ints[j].second<i)++j; for(auto q: ques[2][i]) if(ints[j].first<=q) br=0; } if(br){ string ans=""; char cur='R'; for(auto i:ints){ for(int j=i.first;j<=i.second;++j) ans+=cur; if(cur=='R') cur='B'; else cur='R'; } craft(ans); return 1; } else return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccdwI9Kr.o: in function `main':
grader.cpp:(.text.startup+0x267): undefined reference to `construct(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status