제출 #609759

#제출 시각아이디문제언어결과실행 시간메모리
609759sword060Unscrambling a Messy Bug (IOI16_messy)C++17
0 / 100
1 ms340 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; vector<int> restore_permutation(int x, int w, int r){ vector<int> ans(x); for(int i=0;i<x;i++)ans[i]=i+1; string p=""; for(int i=0;i<x;i++)p+='0'; for(int i=0;i<x-1;i++){ p[i]='1';p[i+x/2]='1'; add_element(p); p[i]='0';p[i+x/2]='0'; } compile_set(); for(int i=1;i<x-1;i++){ p[i]='1';p[i+x/2]='1'; bool f=check_element(p); if(f)continue; p[i]='0'; for(int j=0;j<x;j++){ if(j==i+x/2)continue; p[j]='1'; bool f2=check_element(p); if(!f){p[j]='0';continue;} swap(ans[i],ans[j]); return ans; } p[i]='1';p[i+x/2]='0'; for(int j=0;j<x;j++){ if(j==i)continue; p[j]='1'; bool f2=check_element(p); if(!f){p[j]='0';continue;} swap(ans[i],ans[j]); return ans; } } return ans; }

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

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:23:12: warning: unused variable 'f2' [-Wunused-variable]
   23 |       bool f2=check_element(p);
      |            ^~
messy.cpp:32:12: warning: unused variable 'f2' [-Wunused-variable]
   32 |       bool f2=check_element(p);
      |            ^~
#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...