Submission #276264

#TimeUsernameProblemLanguageResultExecution timeMemory
276264brcodeUnscrambling a Messy Bug (IOI16_messy)C++14
20 / 100
1 ms384 KiB
#include <iostream> #include <bits/stdc++.h> #include "messy.h" using namespace std; const int MAXN = 5010; bool blocked[MAXN]; vector<int> v1; vector<int> restore_permutation(int bits,int r,int w){ vector<int> p(bits); string s=""; s+='1'; for(int i=2;i<=bits;i++){ s+='0'; } add_element(s); for(int i=1;i<bits;i++){ s[i] = '1'; add_element(s); } compile_set(); s = ""; for(int i=1;i<=bits;i++){ s+='0'; } for(int i=0;i<bits;i++){ int currbit = -1; for(int j=0;j<bits;j++){ if(blocked[j]){ continue; } s[j] = '1'; if(check_element(s)){ p[i] = j; blocked[j]=true; v1.push_back(p[i]); break; } s[j] = '0'; } for(int j=0;j<bits;j++){ s[j] = '0'; } for(int x:v1){ s[x] = '1'; } } return p; }

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:26:13: warning: unused variable 'currbit' [-Wunused-variable]
   26 |         int currbit = -1;
      |             ^~~~~~~
#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...