제출 #1357309

#제출 시각아이디문제언어결과실행 시간메모리
1357309AMel0nSouvenirs (IOI25_souvenirs)C++20
21 / 100
9 ms412 KiB
#include "souvenirs.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void buy_souvenirs(int N, ll P0) {
  vector<int> took(N);
  vector<ll> cost(N);
  cost[0] = P0;
  for(int i = 1; i < N; i++) {
    while(took[i] != i) {
      if (cost[i] == 0) {
        pair<vector<int>, ll> re = transaction(cost[i-1]-1);
        cost[i] = cost[i-1]-1;
        if (re.second || re.first.size() > 1) {
          cost[i]--;
          took[re.first[1]]++;
        }
      } else {
        pair<vector<int>, ll> re = transaction(cost[i]);
      }
      took[i]++;
    }
  }
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…