Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
133404 刘益梵 18排列骨头 C++ Time Limit Exceeded 1000 MS 244 KB 639 2025-10-18 16:56:17

Tests(0/1):


Code:

#include<bits/stdc++.h> using namespace std; int a[100]; //0:没有取出,1:已经取出 int main(){ int cnt=0,i=1,ss=1; //取出的个数;位置 while(cnt<15){ if(a[i]==9){//没有取出来的位置报数 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<<" "; } } return 0; }