QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#342894 | #7619. Make SYSU Great Again I | Lain | WA | 0ms | 3756kb | C++23 | 1.4kb | 2024-03-01 19:20:48 | 2024-03-01 19:20:48 |
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),
};
vector<pii> delta = {
make_pair(1, 1),
make_pair(1, -1),
make_pair(-1, -1),
make_pair(-1, 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;
pts[j].first += delta[j].first;
pts[j].second += delta[j].second;
curr++;
if (curr <= k) {
cout << '\n';
}
}
}
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;
curr += 2;
if (curr <= k) {
cout << '\n';
}
}
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;;
if (i < k) {
cout << '\n';
}
taken.insert({currx, curry});
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3756kb
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 -317606784 is not the same.