Submission #996248

# Submission time Handle Problem Language Result Execution time Memory
996248 2024-06-10T09:21:30 Z salmon Jobs (BOI24_jobs) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

int N;
vector<int> root;
int h,h1;
long long int lst[300100];
int parent[300100];

pair<set<long long int>*,long long int> dfs(int i, int p){
	
}

int main(){
	scanf(" %d",&N);
	
	for(int i = 1; i <= N; i++){
		scanf(" %d",&h);
		scanf(" %d",&h1);
		
		if(h1 == 0){
			root.push_back(i);
		}
		lst[i] = h;
		parent[i] = h1;
	}
	
	for(int i : root){
		dfs(root,-1);
	}
}

Compilation message

Main.cpp: In function 'std::pair<std::set<long long int>*, long long int> dfs(int, int)':
Main.cpp:12:1: warning: no return statement in function returning non-void [-Wreturn-type]
   12 | }
      | ^
Main.cpp: In function 'int main()':
Main.cpp:29:7: error: cannot convert 'std::vector<int>' to 'int'
   29 |   dfs(root,-1);
      |       ^~~~
      |       |
      |       std::vector<int>
Main.cpp:10:49: note:   initializing argument 1 of 'std::pair<std::set<long long int>*, long long int> dfs(int, int)'
   10 | pair<set<long long int>*,long long int> dfs(int i, int p){
      |                                             ~~~~^
Main.cpp:28:10: warning: unused variable 'i' [-Wunused-variable]
   28 |  for(int i : root){
      |          ^
Main.cpp:15:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |  scanf(" %d",&N);
      |  ~~~~~^~~~~~~~~~
Main.cpp:18:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |   scanf(" %d",&h);
      |   ~~~~~^~~~~~~~~~
Main.cpp:19:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |   scanf(" %d",&h1);
      |   ~~~~~^~~~~~~~~~~