#include "souvenirs.h"
#include <utility>
#include <vector>
#include <bits/stdc++.h>
#define int long long
using namespace std;
void buy_souvenirs(int32_t N, long long P0) {
//let's say that you start by doing P[0]-1
//this guarantees that you buy the first souvenir
//then you can repeat the same process with the rest of the souvenirs
//ok so our method is
//start with P[0]-1
//then let S be the set of bought souvenirs
//take the average of S (it's known from the given info)
//transaction based on this
//then say the first souvenir bought is i, it means that from 1 to i-1 the souvenirs are more than S
//and from i to N-1 the souvenirs are less than S
//solve i to N-1 recursively with the same process
//and then solve 1 to i-1 also recursively using the info from i to N-1
//and then once we know all the values we can do the required transactions with full information
//N=2 sol
pair<vector<int32_t>, long long> res = transaction(P0-1);
return;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |