QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#304522 | #7619. Make SYSU Great Again I | Detach | WA | 0ms | 3428kb | C++17 | 1.3kb | 2024-01-13 20:46:10 | 2024-01-13 20:46:11 |
Judging History
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