제출 #59803

#제출 시각아이디문제언어결과실행 시간메모리
59803alenam0161Unscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
3 ms512 KiB
#include <vector> #include "messy.h" #include <bits/stdc++.h> using namespace std; const int N = 4007; int wh[N]; bool used[N]; std::vector<int> restore_permutation(int n, int w, int r) { srand(1572921); string s=string(n,'0'); for(int i=1;i<n;++i){ string s1=string(i,'1'); s1+=string(n-i,'0'); add_element(s1); } compile_set(); for(int i=0;i<n-1;++i){ string sx=s; vector<int> l; for(int j=0;j<n;++j){ if(used[j]==0){ l.push_back(j); } } random_shuffle(l.begin(),l.end()); for(int j=0;j<l.size();++j){ string nw=s; nw[l[j]]='1'; if(check_element(nw)==true){ s[l[j]]='1'; wh[l[j]]=i; used[l[j]]=true; break; } } } for(int j=0;j<n;++j){ if(used[j]==0)wh[j]=n-1; } vector<int> ans; for(int i=0;i<n;++i){ ans.push_back(wh[i]); } return ans; }

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

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:26:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j<l.size();++j){
                     ~^~~~~~~~~
#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...