제출 #1310950

#제출 시각아이디문제언어결과실행 시간메모리
1310950hmms127기지국 (IOI20_stations)C++20
컴파일 에러
0 ms0 KiB
//#include "stations.h" #include <vector> #include<bits/stdc++.h> #define pb push_back using namespace std; std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { vector<int>labels(n); for(int i=0;i<n;i++)labels[i]=i; return labels; } int find_next_station(int s, int t, std::vector<int> c) { auto can=[&](int node,int par){ if(par==node)return 1; while(par>=node){ par-=1;par/=2; if(par==node)return 1; } return (par==node); }; for(auto it:c){ if(can(it,t))return it; } return c[0]; }

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

stations.cpp: In lambda function:
stations.cpp:18:20: error: inconsistent types 'int' and 'bool' deduced for lambda return type
   18 |         return (par==node);
      |                ~~~~^~~~~~~