제출 #282134

#제출 시각아이디문제언어결과실행 시간메모리
282134thtsshz_bgwrswh질문 (CEOI14_question_grader)C++17
100 / 100
5079 ms48184 KiB
#include<algorithm> #include<string> using namespace std; static bool first=1; static string s[925]; int encode(int n,int x,int y){ int i; if(first){ first=0; for(i=0;i<12;i++) s[1]+=(i<6)?"0":"1"; for(i=2;i<=920;i++){ s[i]=s[i-1]; next_permutation(s[i].begin(),s[i].end()); } } for(i=0;i<12;i++) if(s[x][i]=='1'&&s[y][i]=='0') return i+1; return -1; }
#include<algorithm> #include<string> using namespace std; static bool first=1; static string s[925]; int decode(int n,int q,int h){ int i; if(first){ first=0; for(i=0;i<12;i++) s[1]+=(i<6)?"0":"1"; for(i=2;i<=920;i++){ s[i]=s[i-1]; next_permutation(s[i].begin(),s[i].end()); } } return s[q][h-1]=='1'; }
#Verdict Execution timeMemoryGrader output
Fetching results...