제출 #430067

#제출 시각아이디문제언어결과실행 시간메모리
430067TheWilp자동 인형 (IOI18_doll)C++14
0 / 100
6 ms5068 KiB
#include "doll.h" #include <vector> std::vector<int> f[100005]; int cnt = 1; std::vector<int> C; std::vector<int> X; std::vector<int> Y; int create(int pos,int left,int right){ if(right == left) return f[pos][left]; int node_create = cnt; cnt++; int mid = (right + left) / 2; X.push_back(0);Y.push_back(0); X[node_create - 1] = create(pos,left,mid); Y[node_create - 1] = create(pos,mid + 1,right); return -node_create; } void create_circuit(int M, std::vector<int> A) { for(int q = 1;q<A.size();q++){ f[A[q - 1]].push_back(A[q]); } f[A.back()].push_back(0); C.push_back(A[0]); for(int q = 1 ;q<=M;q++){ C.push_back(create(q,0,f[q].size())); } answer(C,X,Y); }

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

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