# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1132840 | Gray | Zalmoxis (BOI18_zalmoxis) | C++20 | 192 ms | 327680 KiB |
#include <bits/stdc++.h>
#include <cassert>
#include <iomanip>
#include <tuple>
#include <vector>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define ff first
#define ss second
#define ln "\n"
#define mp make_pair
#define INF 2e18
#define MOD 1e9+7
void get(ll x, ll &i, vector<ll> &a, vector<ll> &res, ll &k){
if (i<(ll)a.size() and a[i]==x){
res.push_back(a[i]);
i++; return;
}else if (k and (i==(ll)a.size() or a[i]>x)){
if (k==1 or x==0){
res.push_back(x); k--;
}else{
k--; get(x-1, i, a, res, k);
k++; get(x-1, i, a, res, k);
}
}else{
if (k==0 and i==(ll)a.size()) return;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |