Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
131976 周荣浩 22数列变换III C++ Compile Error 0 MS 0 KB 365 2025-10-02 15:26:48

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'void move(int)':
Main.cc:6:19: error: 'n' was not declared in this scope
  for(int i=idx;i<=n;i++){
                   ^
Main.cc:9:4: error: 'n' was not declared in this scope
  a[n]=tp;
    ^
Main.cc: In function 'int main()':
Main.cc:20:8: error: 't' was not declared in this scope
   cin>>t;
        ^
Main.cc:13:10: warning: unused variable 'x' [-Wunused-variable]
  int n,k,x;
          ^