QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#266779 | #7619. Make SYSU Great Again I | March_April# | WA | 0ms | 3752kb | C++20 | 801b | 2023-11-26 17:35:00 | 2023-11-26 17:35:00 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
vector<pair<int, int>> res;
int j = 0;
vector<vector<int>> st(n + 1, vector<int> (n + 1));
for(int i = 1;i <= n; i ++)
{
res.push_back({i, i});
if(i != n)
res.push_back({i, i + 1});
else
res.push_back({i, 1});
st[i][i] = st[i][i + 1] = true;
}
vector<pair<int, int>> nop;
for(int i = 1;i <= n; i ++)
for(int j = 1;j <= n; j ++)
if(!st[i][j]) nop.push_back({i, j});
while(res.size() < k)
{
res.push_back(nop.back());
nop.pop_back();
}
for(auto [x, y] : res)
cout << x << ' ' << y << '\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
input:
3 6
output:
1 1 1 2 2 2 2 3 3 3 3 1
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
3 7
output:
1 1 1 2 2 2 2 3 3 3 3 1 3 2
result:
ok The answer is correct.
Test #3:
score: 0
Accepted
time: 0ms
memory: 3464kb
input:
2 4
output:
1 1 1 2 2 2 2 1
result:
ok The answer is correct.
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3752kb
input:
3 9
output:
1 1 1 2 2 2 2 3 3 3 3 1 3 2 3 1 2 1
result:
wrong answer The answer is wrong: Multiple numbers filled in a grid.