Submission #95199

#TimeUsernameProblemLanguageResultExecution timeMemory
95199someone_aaUnscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
3 ms384 KiB
#include <vector> #include <bits/stdc++.h> #include "messy.h" using namespace std; bool taken[130]; std::vector<int> restore_permutation(int n, int w, int r) { string zeros; for(int i=0;i<n;i++) { zeros += "0"; } for(int i=1;i<n;i++) { string tmp = zeros; for(int j=1;j<=i;j++) { tmp[j-1] = '1'; } add_element(tmp); } compile_set(); vector<int>result(n, 0); string tmp = zeros; for(int i=1;i<=n;i++) { for(int j=0;j<n;j++) { if(!taken[j]) { tmp[j] = '1'; if(check_element(tmp)) { taken[j] = true; result[j] = i-1; break; } else { tmp[j] = '0'; } } } } for(int i=0;i<result.size();i++) { if(!taken[i]) result[i] = n - 1; } return result; }

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:44:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<result.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...