QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#249261#7619. Make SYSU Great Again Iucup-team992#WA 0ms3724kbC++17890b2023-11-12 02:31:002023-11-12 02:31:00

Judging History

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

  • [2023-11-12 02:31:00]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3724kb
  • [2023-11-12 02:31:00]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef int uci;
#define int long long
#define F first
#define S second
#define ar array

void solve(){
    int n, k;
    cin >> n >> k;

    int x{}, y{};
    for(int i{1}; i <= k; ++i){
        if(i < 2*n){
            cout << ((i+1)/2) << ' ' << ((i+1)/2+(i%2==0)) << '\n';
        }else if(i == 2*n){
            cout << n << ' ' << 1 << '\n';
        }else{
            while(true){
                if(y == x || y == x+1){
                    y++;
                    x += y/n;
                    y %= n;
                }else{
                    cout << x+1 << ' ' << y+1 << '\n';
                    y++;
                    x += y/n;
                    y %= n;
                    break;
                }
            }
        }
    }
}

uci main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 3724kb

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: 3668kb

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: 3720kb

input:

3 9

output:

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

result:

wrong answer The answer is wrong: Multiple numbers filled in a grid.