제출 #315231

#제출 시각아이디문제언어결과실행 시간메모리
315231thtsshz_bgwrswhMouse (info1cup19_mouse)C++17
35.33 / 100
3074 ms288 KiB
#pragma GCC optimize("Ofast") #include "grader.h" #include<stdio.h> #include<algorithm> #include<assert.h> using namespace std; int num[500]; bool check[500],wrong[500]; void solve(int n){ int i,j; for(i=0;i<n;i++) wrong[i]=check[i]=0; vector<int> vec(n); for(i=0;i<n;i++) vec[i]=i+1; random_shuffle(vec.begin(),vec.end()); int now=query(vec); if(now==n) return; while(1){ for(i=0;i<n;i++){ for(j=i+1;j<n;j++){ if(check[i]||check[j]) continue; swap(vec[i],vec[j]); int v=query(vec); if(v==n) return; if(v==now+2){ now+=2; check[i]=check[j]=1; break; } else if(v==now+1) now++; else swap(vec[i],vec[j]); } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...