제출 #207074

#제출 시각아이디문제언어결과실행 시간메모리
207074autumn_eelUnscrambling a Messy Bug (IOI16_messy)C++14
38 / 100
5 ms376 KiB
#include "messy.h" #include <bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; typedef pair<int,int>P; vector<int> restore_permutation(int n, int w, int r) { if(n<=32){ rep(i,n){ string s; rep(j,n){ if(j<=i)s+='0'; else s+='1'; } add_element(s); } compile_set(); vector<int>v(n),p(n);//p[v[i]]=i random_device rnd; rep(i,n){ string s(n,'1'); rep(j,i)s[v[j]]='0'; vector<int>c; rep(j,n){ if(s[j]=='1')c.push_back(j); } shuffle(c.begin(),c.end(),rnd); rep(k,c.size()){ int j=c[k]; if(s[j]=='0')continue; s[j]='0'; if(check_element(s)){ v[i]=j;break; } s[j]='1'; } } rep(i,n){ p[v[i]]=i; } return p; } return {}; }

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

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:3:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define rep(i,n)for(int i=0;i<(n);i++)
                              ^
messy.cpp:28:4: note: in expansion of macro 'rep'
    rep(k,c.size()){
    ^~~
#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...