Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
93931 | 只因你太美(Ikun 真爱粉) | 22数列变换III | C++ | Wrong Answer | 1 MS | 268 KB | 743 | 2024-10-19 15:48:34 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() #include<string> using namespace std; int main(){ int n,bb,ma=0; cin>>n; int a[n],b[n]; for(int i=0;i<n;i++){ cin>>a[i]; } int k; cin>>k; for(int i=0;i<k;i++){ cin>>bb; for(int j=0;j<bb;j++){ if(a[j]==0){ma++;} } b[i]=a[ma]; a[ma]=0;ma=0; } for(int i=0;i<n;i++){ if(a[i]==0)continue; cout<<a[i]<<" "; } for(int i=0;i<k;i++){ cout<<b[i]<<" "; } return 0; }
------Input------
10 1 2 3 4 5 6 7 8 9 10 4 4 3 2 5
------Answer-----
1 5 6 7 9 10 4 3 2 8
------Your output-----
5 6 7 8 9 10 1 2 3 4