B1008

#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<string>
#include<ctime>
using namespace std;

int main()
{
    int N,M;
    scanf("%d %d",&N,&M);
    int v[101];
    for(int i=0;i<N;i++){
        scanf("%d",&v[i]);
    }
    M=M%N;
    for(int i=0;i<N;i++){
        printf("%d",v[(N-M+i)%N]);
        if(i!=N-1)
            printf(" ");
    }
    printf("\n");
    return 0;
}
 

直接利用性质来写就行,不用模拟

猜你喜欢

转载自blog.csdn.net/fengwuyaQAQ/article/details/85613085
今日推荐