제출 #116378

#제출 시각아이디문제언어결과실행 시간메모리
116378valentin_imbachUnscrambling a Messy Bug (IOI16_messy)C++14
38 / 100
4 ms384 KiB
#include <vector> #include "messy.h" #include <iostream> using namespace std; string fill(string s, int n) { while (s.size() < n) { s += '0'; } return s; } vector<int> restore_permutation(int n, int w, int r) { string s = fill("",n); vector<int> p = vector<int>(n); string b = s; for (int i = 0; i < n; i++) { b[i] = '1'; //cout << b << endl; add_element(b); } compile_set(); for (int k = 0; k < n; k++) { string b = s; for (int i = 0; i < n; i++) { if (b[i] == '1') { continue; } b[i] = '1'; //cout << b << endl; if (check_element(b)) { p[i] = k; s[i] = '1'; break; } b[i] = '0'; } } return p; }

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

messy.cpp: In function 'std::__cxx11::string fill(std::__cxx11::string, int)':
messy.cpp:9:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  while (s.size() < n) {
         ~~~~~~~~~^~~
#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...