| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1306944 | michael12 | 선물 (IOI25_souvenirs) | C++20 | 0 ms | 0 KiB |
#include "souvenirs.h"
#include<bits/stdc++.h>
#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, int 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);
}
}
using namespace std;
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;
}
}
