Submission #1306943

#TimeUsernameProblemLanguageResultExecution timeMemory
1306943michael12Souvenirs (IOI25_souvenirs)C++20
Compilation error
0 ms0 KiB
#include "souvenirs.h"
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sm pair<vector<int>, long long>
void sub3(int n, P0){
   sm T = transaction(P0 - 1);
   if(T.ff.size() == 1){
      int p1 = P0 - 1 - T.ss;
      transaction(p1 - 1);
      transaction(p1 - 1);
   }
   else{
     int sm2 = P0 - 1 - T.ss;
     transaction(sm2 / 2);
     transaction(sm2 / 2);
   }
}
void buy_souvenirs(int N, long long P0){
     long long p = P0;
     if(N == 2){
     transaction(p - 1);
     return;
     }
     if(N == 3){
        sub3(N, P0);
        return;
     }
     
}

Compilation message (stderr)

souvenirs.cpp:9:18: error: 'P0' has not been declared
    9 | void sub3(int n, P0){
      |                  ^~
souvenirs.cpp: In function 'void sub3(int, int)':
souvenirs.cpp:10:23: error: 'P0' was not declared in this scope; did you mean 'y0'?
   10 |    sm T = transaction(P0 - 1);
      |                       ^~
      |                       y0