| Task: | Hypyt |
| Sender: | jubidubi |
| Submission time: | 2025-10-19 18:10:57 +0300 |
| Language: | C++ (C++11) |
| Status: | READY |
| Result: | 100 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 30 |
| #2 | ACCEPTED | 70 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | 1, 2 | details |
| #2 | ACCEPTED | 0.01 s | 1, 2 | details |
| #3 | ACCEPTED | 0.11 s | 2 | details |
| #4 | ACCEPTED | 0.24 s | 2 | details |
| #5 | ACCEPTED | 0.37 s | 2 | details |
Code
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void move(int &x1, int &y1, int x2, int y2) {
cout << y2 - y1 << " " << x2 - x1 << endl;
x1 = x2;
y1 = y2;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int ttt;
cin >> ttt;
while (ttt--) {
int h, w;
cin >> h >> w;
int x = 1;
int y = 1;
int y1 = 1;
int y2 = h;
while (y1 < y2) {
move(x, y, w, y2);
for (int i = 1; i < w; ++i) {
move(x, y, i + 1, y1);
move(x, y, w - i, y2);
}
++y1;
--y2;
if (y1 <= y2) move(x, y, 1, y1);
}
if (y1 == y2) {
if (w != 1) move(x, y, w, y1);
for (int i = 1; i < w / 2 + (w % 2); ++i) {
move(x, y, i + 1, y);
if (i + 1 == w - i) break;
move(x, y, w - i, y);
}
}
}
}
Test details
Test 1
Group: 1, 2
Verdict: ACCEPTED
| input |
|---|
| 25 1 1 1 2 1 3 1 4 ... |
| correct output |
|---|
| 0 1 0 2 0 -1 0 3 0 -2 ... |
| user output |
|---|
| 0 1 0 2 0 -1 0 3 0 -2 ... Truncated |
Test 2
Group: 1, 2
Verdict: ACCEPTED
| input |
|---|
| 100 5 5 5 5 5 5 5 5 ... |
| correct output |
|---|
| 4 4 -4 -3 4 2 -4 -1 4 0 ... |
| user output |
|---|
| 4 4 -4 -3 4 2 -4 -1 4 0 ... Truncated |
Test 3
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 1 25 20 40 5 34 50 34 ... |
| correct output |
|---|
| 0 24 0 -23 0 22 0 -21 0 20 ... |
| user output |
|---|
| 0 24 0 -23 0 22 0 -21 0 20 ... Truncated |
Test 4
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 46 47 41 39 46 36 46 30 ... |
| correct output |
|---|
| 45 46 -45 -45 45 44 -45 -43 45 42 ... |
| user output |
|---|
| 45 46 -45 -45 45 44 -45 -43 45 42 ... Truncated |
Test 5
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 50 50 50 50 50 50 50 50 ... |
| correct output |
|---|
| 49 49 -49 -48 49 47 -49 -46 49 45 ... |
| user output |
|---|
| 49 49 -49 -48 49 47 -49 -46 49 45 ... Truncated |
