QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#248463 | #7619. Make SYSU Great Again I | ucup-team093# | WA | 0ms | 3616kb | C++14 | 1.1kb | 2023-11-11 19:17:39 | 2023-11-11 19:17:40 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, k;
cin >> n >> k;
using pii = pair<int, int>;
vector<pii> ans;
if(n & 1) {
ans = {pii{1, 1}, pii{2, 2}, pii{1, 3}, pii{2, 3}, pii{3, 1}, pii{3, 2}};
for(int i = 4; i <= n; i += 2) {
ans.emplace_back(i, i + 1);
ans.emplace_back(i, i);
ans.emplace_back(i + 1, i + 1);
ans.emplace_back(i + 1, i);
}
}else{
for(int i = 1; i <= n; i += 2) {
ans.emplace_back(i, i + 1);
ans.emplace_back(i, i);
ans.emplace_back(i + 1, i + 1);
ans.emplace_back(i + 1, i);
}
}
vector<pii> v(ans);
sort(v.begin(), v.end());
for(int i = 1; i <= n && ans.size() < k; i ++)
for(int j = 1; j <= n && ans.size() < k; j ++)
if(!binary_search(v.begin(), v.end(), pii{i, j}))
ans.emplace_back(i, j);
for(auto [x, y] : ans)
cout << x << " " << y << "\n";
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3616kb
input:
3 6
output:
1 1 2 2 1 3 2 3 3 1 3 2
result:
ok The answer is correct.
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3488kb
input:
3 7
output:
1 1 2 2 1 3 2 3 3 1 3 2 1 2
result:
wrong answer The answer is wrong: The maximum common divisor of row 2 and column -1427700608 is not the same.