제출 #995442

#제출 시각아이디문제언어결과실행 시간메모리
995442irmuun참나무 (IOI23_beechtree)C++17
0 / 100
2028 ms20444 KiB
#include<bits/stdc++.h> #include "beechtree.h" using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() #define pii pair<int,int> vector<int>beechtree(int n,int m,vector<int>p,vector<int>c){ vector<int>g[n]; for(int i=1;i<n;i++){ g[p[i]].pb(i); } function <bool(int,int)> comp=[&](int i,int j){ return g[i].size()>g[j].size(); }; vector<int>b(n,0),f(m+1,0); for(int i=0;i<n;i++){ vector<int>u; priority_queue<pii,vector<pii>,greater<pii>>q; q.push({g[i].size(),i}); while(!q.empty()){ auto [sz,x]=q.top(); u.pb(x); q.pop(); for(int y:g[x]){ q.push({g[y].size(),y}); } } bool ok=true; for(int j=1;j<u.size();j++){ if(p[u[j]]!=u[f[c[u[j]]]]){ ok=false; break; } f[c[u[j]]]++; } if(ok){ b[i]=1; } fill(all(f),0); } return b; }

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

beechtree.cpp: In function 'std::vector<int> beechtree(int, int, std::vector<int>, std::vector<int>)':
beechtree.cpp:36:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |         for(int j=1;j<u.size();j++){
      |                     ~^~~~~~~~~
#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...