제출 #430225

#제출 시각아이디문제언어결과실행 시간메모리
430225TheWilp자동 인형 (IOI18_doll)C++14
6 / 100
91 ms12592 KiB
#include "doll.h" #include <vector> #include <iostream> 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){ //std::cout << pos << " " << left << " " << right << std::endl; 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); int get1 = create(pos,left,mid); int get2 =create(pos,mid + 1,right); X[node_create - 1] = get1; Y[node_create - 1] = get2; return -node_create; } void print_vector(std::vector<int>& v){ for(int q = 0 ;q<v.size();q++){ std::cout << v[q] << " "; }std::cout << std::endl; } 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++){ if(f[q].size() == 0) C.push_back(0); else C.push_back(create(q,0,f[q].size() - 1)); } //print_vector(C); //print_vector(X); // print_vector(Y); answer(C,X,Y); }

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

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