제출 #415387

#제출 시각아이디문제언어결과실행 시간메모리
415387Bill_00Unscrambling a Messy Bug (IOI16_messy)C++14
20 / 100
2 ms296 KiB
#include <vector> #include <bits/stdc++.h> #include "messy.h" using namespace std; vector<int> restore_permutation(int n, int w, int r) { if(n==8){ vector<int>per(8); per.assign(8,-1); add_element("10000000"); add_element("11000000"); add_element("11100000"); add_element("11110000"); add_element("11111000"); add_element("11111100"); add_element("11111110"); add_element("11111111"); compile_set(); for(int k=1;k<=8;k++){ for(int i=0;i<256;i++){ int val=__builtin_popcount(i); if(val!=k) continue; string a=""; for(int j=7;j>=0;j--){ if(i&(1<<j)) a+=('1'); else a+='0'; } bool flag=check_element(a); if(flag==1){ int num=__builtin_popcount(i); for(int j=0;j<8;j++){ if(per[j]==-1 && a[j]=='1'){ per[j]=num-1; } } } } } return per; } add_element("0"); compile_set(); check_element("0"); return std::vector<int>(); }
#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...