Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
93130 | Kevin | 18排列骨头 | C++ | Accepted | 0 MS | 264 KB | 422 | 2024-10-11 15:18:45 |
#include<bits/stdc++.h> using namespace std; int a[31]; int main(){ queue<int>q; int s=0; for(int i=1;i<=30;i++){ q.push(i); } while(q.empty()==false){ for(int i=1;i<9;i++){ q.push(q.front()); q.pop(); } s++; q.pop(); if(s==15) break; } while(q.empty()==false){ a[q.front()]=1; q.pop(); } for(int i=1;i<=30;i++){ if(a[i]==1) cout<<i<<" "; } return 0; }