3336:【例57.3】火星人

3336:【例57.3】火星人

信息学奥赛一本通-编程启蒙(C++版)在线评测系统

[例 57.3] 火星人

信息学奥赛一本通-编程启蒙(C++版)在线评测系统




/*
1929:【04NOIP普及组】火星人
http://ybt.ssoier.cn:8088/problem_show.php?pid=1929

https://blog.csdn.net/cherish0222/article/details/53204441
*/
#include<cstdio>
#include<algorithm>
 
using namespace std;
const int maxn = 10000+5;
int num[maxn];
 
int main()
{
    int n,m;
    while( scanf("%d%d",&n,&m) == 2)
    {
        for( int i = 0; i < n; i++)
            scanf("%d",&num[i]);
 
        for( int i = 0; i < m; i++)
            next_permutation(num,num+n);
 
        for( int i = 0; i < n; i++)
            printf(i==n-1?"%d\n":"%d ",num[i]);
 
    }
 
    return 0;
}



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



 




3012:练4.1 阿布拉1(Scratch、C、C++、python)

3012:练4.1 阿布拉1(Scratch、C、C++、python)_尼克是一位好学的学生,他经常做实验。有一天他在做实验的时候需要交换一瓶 毫升的-CSDN博客

Python信息技术学考一本通题目讲解、python入门、python习题集整理汇总等

Python信息技术学考一本通题目讲解、python入门、python习题集整理汇总等 - 哔哩哔哩

Python信息技术学考一本通题目讲解

Python信息技术学考一本通题目讲解_哔哩哔哩_bilibili

Python等级考试(1级-6级)全套真题讲解| 2023年3月

Python等级考试(1级-6级)全套真题讲解| 2023年3月_哔哩哔哩_bilibili

用Python学习数学系列

用Python学习数学系列_哔哩哔哩_bilibili

电子学会python三级考试知识点讲解教学视频

电子学会python三级考试知识点讲解教学视频_哔哩哔哩_bilibili

跟着兔子一起研究学习,【Python基础- Python及其数学库】上

跟着兔子一起研究学习,【Python基础- Python及其数学库】上_哔哩哔哩_bilibili

蓝桥STEMA竞赛Python模块(23年10月)

蓝桥STEMA竞赛Python模块(23年10月)_哔哩哔哩_bilibili

NOI题库 python题解

https://blog.csdn.net/dllglvzhenfeng/category_11601976.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

dllglvzhenfeng

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值