QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#741640#7619. Make SYSU Great Again ICarucao#WA 0ms3596kbC++20675b2024-11-13 14:52:222024-11-13 14:52:22

Judging History

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

  • [2024-11-13 14:52:22]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3596kb
  • [2024-11-13 14:52:22]
  • 提交

answer

#include<bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;
const int N=1e6+10;
int n,m,k;
void work()
{
    cin>>n>>k;
    for(int i=1;i<=n;++i)
    {
    	int j=i+1;
    	if(j==n+1) j=1;
    	cout<<i<<" "<<i<<endl;
    	cout<<i<<" "<<j<<endl;
	}
	if(2*n==k) return;
	for(int i=1;i<=n;++i)
	{
		int u=i,v=i+1;
		if(v==n+1) v=1;
		for(int j=1;j<=n;++j)
		{
			if(j==u||j==v) continue;
			cout<<i<<" "<<j<<endl;
		    --k;
		    if(k==0) return;
		}
	}
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int T=1;
    //cin>>T;
    for(;T;--T)
      work();
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3584kb

input:

3 6

output:

1 1
1 2
2 2
2 3
3 3
3 1

result:

ok The answer is correct.

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3596kb

input:

3 7

output:

1 1
1 2
2 2
2 3
3 3
3 1
1 3
2 1
3 2

result:

wrong output format Extra information in the output file