제출 #43999

#제출 시각아이디문제언어결과실행 시간메모리
43999model_code항공 노선도 (JOI18_airline)C++17
37 / 100
734 ms30512 KiB
#include "Alicelib.h" #include <cassert> #include <cstdio> #include <algorithm> #include <vector> using namespace std; void Alice( int N, int M, int A[], int B[] ){ vector<pair<int,int>> G; for(int i = 0 ; i < M ; i ++){ G.push_back(pair<int,int>(A[i],B[i])); } for(int i = 0 ; i < 10 ; i ++){ for(int j = 0 ; j < N ; j ++){ if((j>>i)&1)G.push_back(pair<int,int>(N+i,j)); } G.push_back(pair<int,int>(N+i,N+10)); if(i < 9)G.push_back(pair<int,int>(N+i,N+i+1)); } for(int i = 0 ; i < N+10 ; i ++){ G.push_back(pair<int,int>(i,N+11)); } InitG( N+12, G.size() ); for(int i = 0 ; i < G.size() ; i ++){ MakeG( i, G[i].first, G[i].second ); } }
#include "Boblib.h" #include <cassert> #include <cstdio> #include <vector> using namespace std; void Bob( int V, int U, int C[], int D[] ){ static int N = V-12; static int cnt[1020] = {}; static bool edge[1020][1020]; static bool used[1020]; for(int i = 0 ; i < V ; i ++){ used[i] = false; for(int j = 0 ; j < V ; j ++){ edge[i][j] = false; } } for(int i = 0 ; i < U ; i ++){ cnt[C[i]] ++; cnt[D[i]] ++; edge[C[i]][D[i]] = true; edge[D[i]][C[i]] = true; } static int a = -1; for(int i = 0 ; i < V ; i ++){ if(cnt[i] == N+10){ a = i; break; } } used[a] = true; static int b = -1; for(int i = 0 ; i < V ; i ++){ if(a != i && !edge[i][a]){ b = i; break; } } used[b] = true; static int c[10]; for(int i = 0 ; i < V ; i ++){ if(edge[i][b]){ int cnt_c = 0; for(int j = 0 ; j < V ; j ++){ if(edge[j][b] && edge[i][j])cnt_c ++; } if(cnt_c == 1){ c[0] = i; int k = 1; while(k < 10){ for(int j = 0 ; j < V ; j ++){ if(edge[j][b] && edge[c[k-1]][j] && !(k >= 2 && j == c[k-2])){ c[k] = j; break; } } k ++; } if(cnt[c[0]] < cnt[c[9]]){ for(int j = 0 ; j < 5 ; j ++)swap(c[j],c[9-j]); } break; } } } for(int i = 0 ; i < 10 ; i ++){ used[c[i]] = true; } static int id[1002] = {}; for(int i = 0 ; i < V ; i ++){ if(used[i])continue; for(int j = 0 ; j < 10 ; j ++){ if(edge[i][c[j]])id[i] += 1<<j; } } vector<pair<int,int>> Map; for(int i = 0 ; i < V ; i ++){ if(used[i])continue; for(int j = i+1 ; j < V ; j ++){ if(used[j])continue; if(edge[i][j]){ Map.push_back(pair<int,int>(id[i],id[j])); } } } InitMap( N, Map.size() ); for(int i = 0 ; i < Map.size() ; i ++){ MakeMap( Map[i].first, Map[i].second ); } }

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

Alice.cpp: In function 'void Alice(int, int, int*, int*)':
Alice.cpp:24:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0 ; i < G.size() ; i ++){
                  ~~^~~~~~~~~~

Bob.cpp: In function 'void Bob(int, int, int*, int*)':
Bob.cpp:87:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0 ; i < Map.size() ; i ++){
                  ~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...