Codeforces Round #151 (Div. 2) A. Buggy Sorting

题目:http://codeforces.com/contest/246/problem/A

题目给出错误的冒泡排序法,求反例。

思路:...既然是错误的,任意输出一个递减的数列

#include <iostream>

using namespace std;

int main()
{
	int n;
	cin>>n;
	if(n<=2) cout<<"-1";
	else 
	{
		for(int i=0;i<n-2;i++)
		{
			cout<<n-i<<" ";
		}
		cout<<"2 1";
	}
	
	return 0;
}

  

  

转载于:https://www.cnblogs.com/danielqiu/archive/2013/01/19/2868116.html

猜你喜欢

转载自blog.csdn.net/weixin_33939843/article/details/93795265