Submission #116378

#TimeUsernameProblemLanguageResultExecution timeMemory
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; }

Compilation message (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...