제출 #115517

#제출 시각아이디문제언어결과실행 시간메모리
115517onjo0127자동 인형 (IOI18_doll)C++11
18 / 100
30 ms2232 KiB
#include "doll.h" #include <bits/stdc++.h> using namespace std; void create_circuit(int M, vector<int> A) { int N = A.size(); vector<int> C(M + 1); C[0] = -1; C[1] = -1; int i; for(i=1; (1<<i)<=N; i++); vector<int> X(i), Y(i); int x = N; vector<int> S; while(x) { S.push_back(x%2); x /= 2; } reverse(S.begin(), S.end()); for(int j=0; j<i; j++) X[j] = -1, Y[j] = -j-2; Y[i-1] = 0; for(int i=0; i<S.size(); i++) { if(S[i]) X[i] = 1; } answer(C, X, Y); }

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

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