제출 #1306110

#제출 시각아이디문제언어결과실행 시간메모리
1306110exoworldgd선물 (IOI25_souvenirs)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "souvenirs.h"
#define ll long long
#define exoworldgd cin.tie(0)->sync_with_stdio(0),cout.tie(0)
using namespace std;
int N,b[105];
ll p[105];
void f(int idx,ll up) {
    if(idx>=N||p[idx]^-1)return;
    auto[it,ch]=transaction(up-1);
    for(int t:it)b[t]++;
    ll lo=ch,rm,av;
    for(int i=it.size()-1,t;i;i--) {
        t=it[i];
        if(p[t]^-1)rm=up-1-lo,av=rm/(i+1)+1,f(t,av);
        lo+=p[t];
    }
    p[it[0]]=up-1-lo,rec(it[0]+1,p[it[0]]);
}
void buy_souvenirs(int n, ll P0) {
    N=n;
    for(int i=0;i<N;i++)p[i]=-1,b[i]=0;
    p[0]=P0,f(1,P0);
    for(int i=1;i<N;i++) {
        while(b[i]<i) {
            auto[it,ch]=transaction(p[i]);
            for(int t:it)b[t]++;
        }
	}
}

컴파일 시 표준 에러 (stderr) 메시지

souvenirs.cpp: In function 'void f(int, long long int)':
souvenirs.cpp:18:22: error: 'rec' was not declared in this scope
   18 |     p[it[0]]=up-1-lo,rec(it[0]+1,p[it[0]]);
      |                      ^~~