Submission #1121939

#TimeUsernameProblemLanguageResultExecution timeMemory
1121939ElayV13Unscrambling a Messy Bug (IOI16_messy)C++17
20 / 100
2 ms348 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; std::vector<int> restore_permutation(int n, int w, int r) { vector < string > s; for(int i = 0;i < n - 1;i++) { string q = ""; for(int j = 0;j <= i;j++) q = q + '0'; for(int j = i + 1;j < n;j++) q = q + '1'; s.push_back(q); add_element(q); } compile_set(); for(int i = 0;i < n;i++) for(int j = i;j < n;j++){ bool f = 1; for(int p = 0;p < n - 1;p++){ string q = s[p]; swap(q[i] , q[j]); f &= check_element(q); } if(f){ vector < int > ans(n); for(int p = 0;p < n;p++) ans[p] = p; swap(ans[i] , ans[j]); return ans; } } }

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:6:22: warning: control reaches end of non-void function [-Wreturn-type]
    6 |    vector < string > s;
      |                      ^
#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...