QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#248469 | #7619. Make SYSU Great Again I | ucup-team093# | WA | 0ms | 3596kb | C++14 | 1.1kb | 2023-11-11 19:21:45 | 2023-11-11 19:21:46 |
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{2, 3}, pii{1, 3}, pii{3, 2}, pii{3, 1}};
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";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3596kb
input:
3 6
output:
1 1 2 2 2 3 1 3 3 2 3 1
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
3 7
output:
1 1 2 2 2 3 1 3 3 2 3 1 1 2
result:
ok The answer is correct.
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3516kb
input:
2 4
output:
1 2 1 1 2 2 2 1
result:
wrong answer The answer is wrong: The maximum common divisor of row 1 and column 351208576 is not the same.