QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#604459#6428. K Co-prime PermutationmysterysRE 0ms0kbC++14538b2024-10-02 11:02:452024-10-02 11:02:48

Judging History

你现在查看的是最新测评结果

  • [2024-10-02 11:02:48]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-10-02 11:02:45]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define FILE(x) freopen(x".in","r",stdin);freopen(x".out","w",stdout);
#define ll long long
#define endl '\n'
int n,k;
signed main(){
	FILE("chase");
	cin.tie(nullptr)->sync_with_stdio(false);
	cout.tie(nullptr);
	cin>>n>>k;
	if(k>n||k<1) return cout<<-1,0;
	if(k&1){
		cout<<1<<' ';
		for(int i=2;i<=k;i++){
			cout<<(i%2==0?i+1:i-1)<<' ';
		}
	}else {
		for(int i=1;i<=k;i++){
			cout<<(i%2==1?i+1:i-1)<<' ';
		}
	}
	for(int i=k+1;i<=n;i++) cout<<i<<' ';
	return 0;
}

详细

Test #1:

score: 0
Dangerous Syscalls

input:

5 3

output:


result: