QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#677900 | #7619. Make SYSU Great Again I | Martian148# | WA | 0ms | 3560kb | C++20 | 733b | 2024-10-26 13:38:27 | 2024-10-26 13:38:52 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MAXN = 5e4 + 5;
ll n, k;
ll dx[2] = {0, 1};
ll dy[2] = {1, 0};
int main(){
ios::sync_with_stdio(false);
map<pair<int, int>, int> mp;
cin >> n >> k;
ll x = 1, y = 1, cnt = 0;
for(int i = 1; i <= 2 * n - 1; i ++){
mp[{x, y}] = 1;
cnt ++;
cout << x << " " << y << '\n';
x += dx[cnt & 1];
y += dy[cnt & 1];
}
if(cnt == k) return 0;
for(int i = 1; i <= n; i ++){
for(int j = 1; j <= n; j ++){
if(!mp[{i, j}]) cout << i << " " << j << "\n", cnt ++;
mp[{i, j}] = 1;
if(cnt == k) return 0;
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3560kb
input:
3 6
output:
1 1 2 1 2 2 3 2 3 3 1 2
result:
wrong answer The answer is wrong: The maximum common divisor of row 3 and column 1618887808 is not the same.