Submission #1311010

#TimeUsernameProblemLanguageResultExecution timeMemory
1311010michael12Souvenirs (IOI25_souvenirs)C++20
Compilation error
0 ms0 KiB
#include "souvenirs.h"
#include<bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define ll long long
#define sm pair<vector<int>, long long>
using namespace std;
const int inf = 1e9;
int n;
int idx;
int e;
vector<int> dp, cnt;
int slv(ll val){
    auto T = transaction(val);
    vector<int> I = T.ff;
    for(auto tt : I){
        cnt[tt]++;
    }
    ll cst = val - T.ss;
    while(I[0] < e){
        while(e <= I.back()){
            cst =- dp[I.back()];
            I.pop_back();
        }
        int e = slv(cost / I.size());
    }
    dp[I[0]] = cst;
    return I[0];
}
void buy_souvenirs(int N, ll P0){
    n = N;
    e = n;
    dp.resize(n);
    cnt.resize(n);
    slv(P0 - 1);
    for(int i = 0; i < n; i++){
        while(cnt[i] < i){
            transaction(dp[i]);
        }
    }
    return; 
}

Compilation message (stderr)

souvenirs.cpp: In function 'int slv(long long int)':
souvenirs.cpp:27:21: error: 'cost' was not declared in this scope; did you mean 'cst'?
   27 |         int e = slv(cost / I.size());
      |                     ^~~~
      |                     cst