Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
149940 陈骏睿 22相差2的数的个数 C++ Wrong Answer 152 MS 272 KB 345 2026-03-21 10:56:39

Tests(0/2):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,a[101]={},k,x,t; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } cin>>k; for(int i=1;i<=k;i++){ cin>>x; t=a[x]; for(int j=x+1;j<=n;j++){ a[j-1]=a[j]; } a[n]=t; } for(int i=1;i<=n;i++)cout<<a[i]<<" "; return 0; }


Run Info:

------Input------
10 80 79 78 77 65 55 54 54 50 49
------Answer-----
3
------Your output-----
65 55 54 54 50 49 0 80 79 78