제출 #430151

#제출 시각아이디문제언어결과실행 시간메모리
430151TheWilp자동 인형 (IOI18_doll)C++14
6 / 100
95 ms12476 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){ 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 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:23:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |     for(int q = 0 ;q<v.size();q++){
      |                    ~^~~~~~~~~
doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:28:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |     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...