QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#248566 | #7619. Make SYSU Great Again I | ucup-team027# | WA | 0ms | 3620kb | C++23 | 1.0kb | 2023-11-11 20:00:35 | 2023-11-11 20:00:35 |
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;
template <typename T> using min_heap = priority_queue<T, vector<T>, greater<T>>;
#define int long long
signed main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, k; cin >> n >> k;
map<pair<int, int>, int> filled;
int x = 1, y = 1;
for (int i = 1; i <= 2*n; i += 2) {
filled[{x, y}] = i;
if (i+1 == 2*n) {
filled[{x, 1}] = i+1;
} else {
filled[{x, y+1}] = i+1;
}
x++; y++;
}
int cur = 2*n+1;
for (x = 1; x <= n; x++) {
if (cur >= k) break;
for (y = 1; y <= n; y++) {
if (cur >= k) break;
if (filled[{x, y}] == 0) {
filled[{x, y}] = cur;
cur++;
}
}
}
vector<pair<int, int>> ans(k+1);
for (auto [u, v]: filled) {
ans[v] = u;
}
for (int i = 1; i <= k; i++) {
cout << ans[i].first << ' ' << ans[i].second << '\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3504kb
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: -100
Wrong Answer
time: 0ms
memory: 3620kb
input:
3 7
output:
1 1 1 2 2 2 2 3 3 3 3 1 0 0
result:
wrong answer Integer 0 violates the range [1, 3]