Submission #1250069

#TimeUsernameProblemLanguageResultExecution timeMemory
1250069kaloyanSouvenirs (IOI25_souvenirs)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 100 + 10; int counter[MAXN]; std::pair<std::vector<int>, long long> transaction(long long M); void buy_souvenirs(int N, long long P0){ if(N == 2) { transaction(P0 - 1); } else if(N == 3) { pair<vector<int>, long long> p = transaction(P0 - 1); if(p.first.size() == 1) { int first_val = (P0 - 1) - R; transaction(first_val - 1); transaction(first_val - 1); } else { int total_sum = (P0 - 1) - R; transaction(total_sum / 2); } } else { for(int i = 0 ; i < N ; ++i) { while(counter[i] < i) { transaction(N - 1); counter[i]++; } } } }

Compilation message (stderr)

souvenirs.cpp: In function 'void buy_souvenirs(int, long long int)':
souvenirs.cpp:25:40: error: 'R' was not declared in this scope
   25 |             int first_val = (P0 - 1) - R;
      |                                        ^
souvenirs.cpp:31:40: error: 'R' was not declared in this scope
   31 |             int total_sum = (P0 - 1) - R;
      |                                        ^