QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#304522#7619. Make SYSU Great Again IDetachWA 0ms3428kbC++171.3kb2024-01-13 20:46:102024-01-13 20:46:11

Judging History

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

  • [2024-01-13 20:46:11]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3428kb
  • [2024-01-13 20:46:10]
  • 提交

answer

#include <bits/stdc++.h>
// #include <algorithm>
// #include <queue>
// #include <map>
// #include <iostream>
// #include <string>
// #include <set>
#define endl '\n'

using namespace std;

using LL = long long;
using PII = pair<int, int>;
using i128 = __int128_t;
using ULL = unsigned long long;

const int INF = 0x3f3f3f3f, MOD = 1e9 + 7, N = 1e6 + 5;
const LL LINF = 0x3f3f3f3f3f3f3f3f;

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

    map<PII, bool> mp;
    int x = 0, y = 0;
    vector<PII> ans;
    for(int i = 0; i < 2 * n - 1; i ++ )
    {
        ans.push_back({x, y});
        mp[{x, y}] = true;

        if(i % 2 == 0) y ++ ;
        else x ++ ;

        if(y == n) x ++ ;
        x %= n, y %= n;
    }

    x = 0, y = 0;
    for(int i = 2 * n; i <= k; i ++ )
    {
        while(mp[{x, y}])
        {
            y ++ ;
            if(y == n) x ++ ;
            x %= n, y %= n;
        }

        mp[{x, y}] = true;
        ans.push_back({x, y});
    }
    
    for(auto [x, y] : ans) cout << x + 1 << ' ' << y + 1 << endl;
}   

int main()
{
    // freopen("galactic.in", "r", stdin);
    ios::sync_with_stdio(false), cin.tie(nullptr);
    int T = 1; 
    // cin >> T;

    while(T -- )
        solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3428kb

input:

3 6

output:

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

result:

wrong answer The answer is wrong: There are fewer than two numbers in one row or column