| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 133407 | 刘轻松 | 18排列骨头 | C++ | Accepted | 1 MS | 256 KB | 673 | 2025-10-18 16:57:02 |
#include<bits/stdc++.h> using namespace std; int a[31]; //0:没有取出,1:已经取出 int main(){ int cnt=0; //取出的个数 int i=1; //位置 int ss=0; //数数 while(cnt<15){ if(a[i] == 0) { //没有取出来的位置报数 ss++; if(ss==9){ //如果这个位置刚好数到9 a[i] = 1; //被取出 cnt++; //取出的次数+1 ss=0; } } i++; //每次循环,位置往后移动 if(i>30) i = 1; //超过最大位置,从新从第一个开始 } //最后遍历一遍,看看任然为0的元素,说明没有被取出 for(int j=1;j<=30;j++){ if(a[j]==0){ cout<<j<<" "; } } }