제출 #1285899

#제출 시각아이디문제언어결과실행 시간메모리
1285899nikakh선물 (IOI25_souvenirs)C++20
컴파일 에러
0 ms0 KiB
#include "souvenirs.h"
#include <bits/stdc++.h>
using namespace std;

void buy_souvenirs(int N, long long P0){
	pair<vector<int>, long long> res;
	if(N == 2){
		transaction(P0 - 1);
		return;
	}
	if(P0 == N){
		for(int i = 1; i < N; i++){
			for(int j = 0; j < i; j++){
				transaction(P0 - i);
			}
		}
		return;
	} if(N == 3){
		res = transaction(P0 - 1);
		auto f = res.first, s = res.second;
		if(f.size() == 2){
			transaction(P0 - 1 - s - 1);
			transaction(P0 - 1 - s - 1);
		} else{
			transaction(P0 - 1 - s - 1);
		}
		return;
	}
}

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

souvenirs.cpp: In function 'void buy_souvenirs(int, long long int)':
souvenirs.cpp:20:17: error: inconsistent deduction for 'auto': 'std::vector<int>' and then 'long long int'
   20 |                 auto f = res.first, s = res.second;
      |                 ^~~~