QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#342886 | #7619. Make SYSU Great Again I | Lain | WA | 0ms | 3640kb | C++23 | 1.1kb | 2024-03-01 19:14:17 | 2024-03-01 19:14:18 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, k;
cin >> n >> k;
set<pii> taken;
vector<pii> pts = {
make_pair(1, 1),
make_pair(1, n),
make_pair(n, n),
make_pair(n, 1),
};
int curr = 1;
rep(i, n%2, (n+1)/2) {
rep(j, 0, 4) {
taken.insert(pts[j]);
cout << pts[j].first << " " << pts[j].second << '\n';
pts[j].first--, pts[j].second--;
}
curr += 4;
}
if (n%2) {
int x = (n+1)/2;
taken.insert({x, x});
cout << x << " " << x << '\n';
taken.insert({x+1, x});
cout << x+1 << " " << x << '\n';
curr += 2;
}
int currx = 1, curry = 1;
rep(i, curr, k+1) {
while(taken.count({currx, curry})) {
currx++;
if (currx > n) {
currx = 1, curry++;
}
}
cout << currx << " " << curry << '\n';
taken.insert({currx, curry});
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3640kb
input:
3 6
output:
1 1 1 3 3 3 3 1 2 2 3 2
result:
wrong answer The answer is wrong: The maximum common divisor of row 2 and column -1430043520 is not the same.