| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 42165 | lmz120809 | 森林之王 | C++ | Compile Error | 0 MS | 0 KB | 441 | 2024-02-24 11:32:42 |
#include<iostream> using namespace std; string s[20]={}; int a[20]; int n,m,j=0,cnt; int mian() { cin>>n>>m; for(int i=0;i<n;i++){ cin>>s[i]; if(s[i]=="tiger"||s[i]=="lion"||s[i]=="dinosaur"){ a[i]=3; } else a[i]=1; } cnt=n; while(cnt>1){ if(a[k]>0) j++; if(j==m){ a[k]--; if(a[k]==0) cnt--; j=0; } k++; k%=n; } for(int i=0;i<n;i++){ if(a[i]) cout<<s[i]; } return 0; }