제출 #1250069

#제출 시각아이디문제언어결과실행 시간메모리
1250069kaloyan선물 (IOI25_souvenirs)C++20
컴파일 에러
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]++;
            }
        }
    
    }

}



컴파일 시 표준 에러 (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;
      |                                        ^