제출 #746187

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7461872023-05-21 18:48:17almothana05통행료 (IOI18_highway)C++14
11 / 100
3054 ms18276 KiB
#include "highway.h"
#include <bits/stdc++.h>
using namespace std;
vector<pair<int , int> >kinder[300000] , ka;
vector<int>cent , ed;
int sub[300000], vis[300000];
long long a , b , menge , cmp , comp ,numm , kind , vase;
int st , en , mid , mit;
void res(){
for(int i = 0 ; i < 300000 ; i++){
kinder[i].clear();
vis[i] = 0;
sub[i] = 0;
}
ka.clear();
cent.clear();
ed.clear();
}
int centroid(int x , int f , int n){
for(int i = 0 ; i < kinder[x].size() ; i++){
kind = kinder[x][i].first;
if(vis[kind] != 2 &&kind != f && sub[kind] * 2 > n){
return centroid(kind , x , n);
}
}
for(int i = 0 ; i < kinder[x].size() ; i++){
ed[kinder[x][i].second] = 1;
}
vis[x] = 2;
return x;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

highway.cpp: In function 'int centroid(int, int, int)':
highway.cpp:20:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |   for(int i = 0 ; i < kinder[x].size() ; i++){
      |                   ~~^~~~~~~~~~~~~~~~~~
highway.cpp:26:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |   for(int i = 0 ; i < kinder[x].size() ; i++){
      |                   ~~^~~~~~~~~~~~~~~~~~
highway.cpp: In function 'int dfs(int)':
highway.cpp:35:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |   for(int i = 0 ; i < kinder[x].size() ; i++){
      |                   ~~^~~~~~~~~~~~~~~~~~
highway.cpp: In function 'long long int suche(int)':
highway.cpp:97:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   97 |   for(int i = 0 ; i < kinder[nummer].size() ; i++ ){
      |                   ~~^~~~~~~~~~~~~~~~~~~~~~~
highway.cpp: In function 'void finde()':
highway.cpp:154:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  154 |   for(int i = 0 ; i < ka.size() ; i++){
      |                   ~~^~~~~~~~~~~
highway.cpp:168:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  168 |           for(int i = 0 ; i < kinder[cent[mid]].size() ; i++){
      |                           ~~^~~~~~~~~~~~~~~~~~~~~~~~~~
highway.cpp:176:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  176 |           for(int i = 0 ; i < kinder[cent[mid]].size() ; i++){
      |                           ~~^~~~~~~~~~~~~~~~~~~~~~~~~~
highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)':
highway.cpp:225:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  225 |   for(int i = 0 ; i < u.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...