제출 #430462

#제출 시각아이디문제언어결과실행 시간메모리
430462TheWilp자동 인형 (IOI18_doll)C++14
37 / 100
178 ms12684 KiB
#include "doll.h" #include <iostream> int cnt = 1; std::vector<int> C; std::vector<int> X; std::vector<int> Y; void print_vector(std::vector<int>& v){ for(int q = 0 ;q<v.size();q++){ std::cout << v[q] << " "; }std::cout << std::endl; } int create(std::vector<int> v){ if(v.size() == 1) return v[0]; X.push_back(0);Y.push_back(0); int node_create = cnt++; std::vector<int> vleft; std::vector<int> vright; for(int q = 0 ;q<v.size();q+=2){ vleft.push_back(v[q]); } for(int q = 1 ;q<v.size();q+=2){ vright.push_back(v[q]); } if(vleft.size() > vright.size()){ vright.push_back(vleft.back()); vleft.back() = -node_create ; } int get1 = create(vleft); int get2 = create(vright); X[node_create - 1] = get1; Y[node_create - 1] = get2; return -node_create; } void create_circuit(int M, std::vector<int> A) { for(int q = 0 ;q<=M;q++){ C.push_back(-1); } A.push_back(0); create(A); answer(C, X, Y); }

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

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