QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#656551#7619. Make SYSU Great Again IyldWA 0ms3624kbC++20848b2024-10-19 13:18:432024-10-19 13:18:49

Judging History

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

  • [2024-10-19 13:18:49]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3624kb
  • [2024-10-19 13:18:43]
  • 提交

answer

#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
void solve()
{
    int n,k;
    cin>>n>>k;
    int cnt=1;
    for(int i=1,j=1;i<=n && j<=n;)
    {
        cnt++;
        cout<<i<<' '<<j<<endl;
        if(cnt%2) i++;
        else j++;
    }
    cout<<n<<' '<<1<<endl;
    cnt++;
    for(int i=1;i<=n && cnt<=k;i++)
    {   
        for(int j=1;j<=n;j++)
        {
            if(i!=n)
            {
                cnt++;
                if(j==i+1 || j==i) continue;
                cout<<i<<' '<<j<<endl;
            }
            else
            {
                cnt++;
                if(j==1 || j==n) continue;
                cout<<i<<' '<<j<<endl;
            }
        }
    }
}
signed main()
{
    cin.tie(0)->sync_with_stdio(0);
    int t=1;
    while(t--) solve();
    return 0;
}

詳細信息

Test #1:

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

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: 0
Accepted
time: 0ms
memory: 3624kb

input:

3 7

output:

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

result:

ok The answer is correct.

Test #3:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

2 4

output:

1 1
1 2
2 2
2 1

result:

ok The answer is correct.

Test #4:

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

input:

3 9

output:

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

result:

wrong output format Unexpected end of file - int32 expected