제출 #206006

#제출 시각아이디문제언어결과실행 시간메모리
206006okoRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
703 ms48204 KiB
#include "railroad.h" #include <cstdio> #include <cassert> #include<bits/stdc++.h> using namespace std; long long n,num; map<long long,int>mp; vector<int>gr[500005],v; void dfs(int x,long long l) { num=max(num,l); for(int i=0;i<gr[x].size();i++) { int u=gr[x][i]; dfs(u,l+1); } } long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { n=s.size(); for(int i=0;i<n;i++) { int x=s[i],u=t[i]; v.push_back(x); v.push_back(u); } sort(v.begin(),v.end()); int k=1; for(int i=0;i<v.size();i++) { if(mp[v[i]]==0)mp[v[i]]=k++; } for(int i=0;i<n;i++) { int x=mp[s[i]],u=mp[t[i]]; gr[x].push_back(u); } dfs(1,0); if(num==n)return 0; else return 1; }

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

railroad.cpp: In function 'void dfs(int, long long int)':
railroad.cpp:12:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<gr[x].size();i++)
                 ~^~~~~~~~~~~~~
railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:29:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<v.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...