제출 #1307827

#제출 시각아이디문제언어결과실행 시간메모리
1307827exoworldgd세계 지도 (IOI25_worldmap)C++20
컴파일 에러
0 ms0 KiB
#include "worldmap.h"
#include <bits/stdc++.h>
#define exoworldgd cin.tie(0)->sync_with_stdio(0),cout.tie(0)
using namespace std;
using ll=long long;
vector<vector<int>>create_map(int n,int m,vector<int>a,vector<int>b){
    vector<int>g[n],tour;
    for(int i=0;i<m;i++)a[i]--,b[i]--,g[a[i]].push_back(b[i]),g[b[i]].push_back(a[i]);
    int vis[n]={},k=2*m+1,depth[n];
    auto dfs=[&](auto&self,int x)->void{
        vis[x]=1,tour.push_back(x);
        for(int i:g[x]){
            if(!vis[i])depth[i]=depth[x]+1,self(self,i),tour.push_back(x);
            else if(depth[x]<depth[i])tour.push_back(i),tour.push_back(x);
        }
    };
    dfs(dfs,0);
    vector<vector<int>>ans(k,vector<int>(k));
    for(int i=0;i<k;i++)for(int j=0;j<k;j++)ans[i][j]=tour[j]+1;
    return ans;
}

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

worldmap.cpp: In function 'std::vector<std::vector<int> > create_map(int, int, std::vector<int>, std::vector<int>)':
worldmap.cpp:10:14: error: use of deleted function 'create_map(int, int, std::vector<int>, std::vector<int>)::<lambda(auto:54&, int)>::~<lambda>()'
   10 |     auto dfs=[&](auto&self,int x)->void{
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   11 |         vis[x]=1,tour.push_back(x);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   12 |         for(int i:g[x]){
      |         ~~~~~~~~~~~~~~~~
   13 |             if(!vis[i])depth[i]=depth[x]+1,self(self,i),tour.push_back(x);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   14 |             else if(depth[x]<depth[i])tour.push_back(i),tour.push_back(x);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   15 |         }
      |         ~     
   16 |     };
      |     ~         
worldmap.cpp:10:16: note: 'create_map(int, int, std::vector<int>, std::vector<int>)::<lambda(auto:54&, int)>::~<lambda>()' is implicitly deleted because the default definition would be ill-formed:
   10 |     auto dfs=[&](auto&self,int x)->void{
      |                ^