제출 #1078205

#제출 시각아이디문제언어결과실행 시간메모리
1078205Marco_Escandon9월 (APIO24_september)C++17
0 / 100
1069 ms1048576 KiB
//#include "september.h" #include <bits/stdc++.h> using namespace std; typedef int ll; #define x first #define y second vector<ll> temp; vector<ll> p; vector<vector<ll>> G; ll dfs(ll node) { ll asd=temp[node]; for(auto i:G[node]) { asd=max(asd,dfs(i)); } p[node]=asd; return asd; } int solve(int n, int m, std::vector<int> F, std::vector<std::vector<int>> S) { G.resize(n+2);temp.resize(n+2);p.resize(n+2); for(int i=0; i<S[0].size(); i++) temp[S[0][i]]=i; for(int i=1; i<n; i++) G[F[i]].push_back(i); dfs(0); ll a=-1; ll cont=0; for(int i=0; i<S[0].size(); i++) { if(i>a) cont++; a=max(p[S[0][i]],a); } return cont; }

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

september.cpp: In function 'int solve(int, int, std::vector<int>, std::vector<std::vector<int> >)':
september.cpp:22:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |  for(int i=0; i<S[0].size(); i++)
      |               ~^~~~~~~~~~~~
september.cpp:29:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |  for(int i=0; i<S[0].size(); i++)
      |               ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...