QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#182396 | #6677. Puzzle: Sashigane | UrgantTeam# | AC ✓ | 1ms | 3896kb | C++23 | 1.4kb | 2023-09-17 22:31:58 | 2023-09-17 22:31:58 |
Judging History
answer
#define _CRT_SECURE_NO_WARNINGS
#define X first
#define Y second
#include <iostream>
#include <vector>
using namespace std;
using pii = pair<int, int>;
struct Angle {
pii t, d;
};
void push_ans(pii u, pii l, const pii p, vector<Angle>& ans) {
while (p.X != u.X && p.Y != u.Y) {
int n = l.X - u.X + 1;
ans.push_back({ u, {n - 1, n - 1} });
++u.X;
++u.Y;
}
while (p.X != u.X && p.Y != l.Y) {
int n = l.X - u.X + 1;
ans.push_back({ {u.X, l.Y}, {n - 1, 1 - n} });
++u.X;
--l.Y;
}
while (p.X != l.X && p.Y != u.Y) {
int n = l.X - u.X + 1;
ans.push_back({ {l.X, u.Y}, {1 - n, n - 1} });
--l.X;
++u.Y;
}
while (p.X != l.X && p.Y != l.Y) {
int n = l.X - u.X + 1;
ans.push_back({ l, {1 - n, 1 - n} });
--l.X;
--l.Y;
}
}
vector<Angle> find_ans(const int n, const pii p) {
vector<Angle> ans;
push_ans({ 1, 1 }, { n, n }, p, ans);
return ans;
}
bool solve_test() {
int n;
pii p;
if (!(cin >> n >> p.X >> p.Y))
return false;
vector<Angle> ans = find_ans(n, p);
cout << "Yes\n";
cout << ans.size() << '\n';
for (const Angle& a : ans)
cout << a.t.X << ' ' << a.t.Y << ' ' << a.d.X << ' ' << a.d.Y << '\n';
return true;
}
void solve_tests() {
while (solve_test());
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
#ifdef ONPC
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
solve_tests();
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3624kb
input:
5 3 4
output:
Yes 4 1 1 4 4 2 2 3 3 5 3 -2 2 4 5 -1 -1
result:
ok Correct. (1 test case)
Test #2:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
1 1 1
output:
Yes 0
result:
ok Correct. (1 test case)
Test #3:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
3 2 3
output:
Yes 2 1 1 2 2 3 2 -1 1
result:
ok Correct. (1 test case)
Test #4:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
10 10 5
output:
Yes 9 1 1 9 9 2 2 8 8 3 3 7 7 4 4 6 6 5 10 5 -5 6 9 4 -4 7 8 3 -3 8 7 2 -2 9 6 1 -1
result:
ok Correct. (1 test case)
Test #5:
score: 0
Accepted
time: 0ms
memory: 3444kb
input:
10 5 7
output:
Yes 9 1 1 9 9 2 2 8 8 3 3 7 7 4 4 6 6 10 5 -5 5 9 6 -4 4 8 10 -3 -3 7 9 -2 -2 6 8 -1 -1
result:
ok Correct. (1 test case)
Test #6:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
10 9 2
output:
Yes 9 1 1 9 9 2 10 8 -8 3 9 7 -7 4 8 6 -6 5 7 5 -5 6 6 4 -4 7 5 3 -3 8 4 2 -2 10 3 -1 -1
result:
ok Correct. (1 test case)
Test #7:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
10 6 10
output:
Yes 9 1 1 9 9 2 2 8 8 3 3 7 7 4 4 6 6 5 5 5 5 10 6 -4 4 9 7 -3 3 8 8 -2 2 7 9 -1 1
result:
ok Correct. (1 test case)
Test #8:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
10 8 4
output:
Yes 9 1 1 9 9 2 2 8 8 3 3 7 7 4 10 6 -6 5 9 5 -5 6 8 4 -4 7 7 3 -3 10 6 -2 -2 9 5 -1 -1
result:
ok Correct. (1 test case)
Test #9:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
999 396 693
output:
Yes 998 1 1 998 998 2 2 997 997 3 3 996 996 4 4 995 995 5 5 994 994 6 6 993 993 7 7 992 992 8 8 991 991 9 9 990 990 10 10 989 989 11 11 988 988 12 12 987 987 13 13 986 986 14 14 985 985 15 15 984 984 16 16 983 983 17 17 982 982 18 18 981 981 19 19 980 980 20 20 979 979 21 21 978 978 22 22 977 977 23...
result:
ok Correct. (1 test case)
Test #10:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
999 963 827
output:
Yes 998 1 1 998 998 2 2 997 997 3 3 996 996 4 4 995 995 5 5 994 994 6 6 993 993 7 7 992 992 8 8 991 991 9 9 990 990 10 10 989 989 11 11 988 988 12 12 987 987 13 13 986 986 14 14 985 985 15 15 984 984 16 16 983 983 17 17 982 982 18 18 981 981 19 19 980 980 20 20 979 979 21 21 978 978 22 22 977 977 23...
result:
ok Correct. (1 test case)
Test #11:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
999 871 185
output:
Yes 998 1 1 998 998 2 2 997 997 3 3 996 996 4 4 995 995 5 5 994 994 6 6 993 993 7 7 992 992 8 8 991 991 9 9 990 990 10 10 989 989 11 11 988 988 12 12 987 987 13 13 986 986 14 14 985 985 15 15 984 984 16 16 983 983 17 17 982 982 18 18 981 981 19 19 980 980 20 20 979 979 21 21 978 978 22 22 977 977 23...
result:
ok Correct. (1 test case)
Test #12:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
999 787 812
output:
Yes 998 1 1 998 998 2 2 997 997 3 3 996 996 4 4 995 995 5 5 994 994 6 6 993 993 7 7 992 992 8 8 991 991 9 9 990 990 10 10 989 989 11 11 988 988 12 12 987 987 13 13 986 986 14 14 985 985 15 15 984 984 16 16 983 983 17 17 982 982 18 18 981 981 19 19 980 980 20 20 979 979 21 21 978 978 22 22 977 977 23...
result:
ok Correct. (1 test case)
Test #13:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
999 396 199
output:
Yes 998 1 1 998 998 2 2 997 997 3 3 996 996 4 4 995 995 5 5 994 994 6 6 993 993 7 7 992 992 8 8 991 991 9 9 990 990 10 10 989 989 11 11 988 988 12 12 987 987 13 13 986 986 14 14 985 985 15 15 984 984 16 16 983 983 17 17 982 982 18 18 981 981 19 19 980 980 20 20 979 979 21 21 978 978 22 22 977 977 23...
result:
ok Correct. (1 test case)
Test #14:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
999 1 1
output:
Yes 998 999 999 -998 -998 998 998 -997 -997 997 997 -996 -996 996 996 -995 -995 995 995 -994 -994 994 994 -993 -993 993 993 -992 -992 992 992 -991 -991 991 991 -990 -990 990 990 -989 -989 989 989 -988 -988 988 988 -987 -987 987 987 -986 -986 986 986 -985 -985 985 985 -984 -984 984 984 -983 -983 983 ...
result:
ok Correct. (1 test case)
Test #15:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
999 163 1
output:
Yes 998 1 999 998 -998 2 998 997 -997 3 997 996 -996 4 996 995 -995 5 995 994 -994 6 994 993 -993 7 993 992 -992 8 992 991 -991 9 991 990 -990 10 990 989 -989 11 989 988 -988 12 988 987 -987 13 987 986 -986 14 986 985 -985 15 985 984 -984 16 984 983 -983 17 983 982 -982 18 982 981 -981 19 981 980 -9...
result:
ok Correct. (1 test case)
Test #16:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
999 999 1
output:
Yes 998 1 999 998 -998 2 998 997 -997 3 997 996 -996 4 996 995 -995 5 995 994 -994 6 994 993 -993 7 993 992 -992 8 992 991 -991 9 991 990 -990 10 990 989 -989 11 989 988 -988 12 988 987 -987 13 987 986 -986 14 986 985 -985 15 985 984 -984 16 984 983 -983 17 983 982 -982 18 982 981 -981 19 981 980 -9...
result:
ok Correct. (1 test case)
Test #17:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
999 1 969
output:
Yes 998 999 1 -998 998 998 2 -997 997 997 3 -996 996 996 4 -995 995 995 5 -994 994 994 6 -993 993 993 7 -992 992 992 8 -991 991 991 9 -990 990 990 10 -989 989 989 11 -988 988 988 12 -987 987 987 13 -986 986 986 14 -985 985 985 15 -984 984 984 16 -983 983 983 17 -982 982 982 18 -981 981 981 19 -980 9...
result:
ok Correct. (1 test case)
Test #18:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
999 999 780
output:
Yes 998 1 1 998 998 2 2 997 997 3 3 996 996 4 4 995 995 5 5 994 994 6 6 993 993 7 7 992 992 8 8 991 991 9 9 990 990 10 10 989 989 11 11 988 988 12 12 987 987 13 13 986 986 14 14 985 985 15 15 984 984 16 16 983 983 17 17 982 982 18 18 981 981 19 19 980 980 20 20 979 979 21 21 978 978 22 22 977 977 23...
result:
ok Correct. (1 test case)
Test #19:
score: 0
Accepted
time: 1ms
memory: 3896kb
input:
999 1 999
output:
Yes 998 999 1 -998 998 998 2 -997 997 997 3 -996 996 996 4 -995 995 995 5 -994 994 994 6 -993 993 993 7 -992 992 992 8 -991 991 991 9 -990 990 990 10 -989 989 989 11 -988 988 988 12 -987 987 987 13 -986 986 986 14 -985 985 985 15 -984 984 984 16 -983 983 983 17 -982 982 982 18 -981 981 981 19 -980 9...
result:
ok Correct. (1 test case)
Test #20:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
999 686 999
output:
Yes 998 1 1 998 998 2 2 997 997 3 3 996 996 4 4 995 995 5 5 994 994 6 6 993 993 7 7 992 992 8 8 991 991 9 9 990 990 10 10 989 989 11 11 988 988 12 12 987 987 13 13 986 986 14 14 985 985 15 15 984 984 16 16 983 983 17 17 982 982 18 18 981 981 19 19 980 980 20 20 979 979 21 21 978 978 22 22 977 977 23...
result:
ok Correct. (1 test case)
Test #21:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
999 999 999
output:
Yes 998 1 1 998 998 2 2 997 997 3 3 996 996 4 4 995 995 5 5 994 994 6 6 993 993 7 7 992 992 8 8 991 991 9 9 990 990 10 10 989 989 11 11 988 988 12 12 987 987 13 13 986 986 14 14 985 985 15 15 984 984 16 16 983 983 17 17 982 982 18 18 981 981 19 19 980 980 20 20 979 979 21 21 978 978 22 22 977 977 23...
result:
ok Correct. (1 test case)
Test #22:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
1000 757 728
output:
Yes 999 1 1 999 999 2 2 998 998 3 3 997 997 4 4 996 996 5 5 995 995 6 6 994 994 7 7 993 993 8 8 992 992 9 9 991 991 10 10 990 990 11 11 989 989 12 12 988 988 13 13 987 987 14 14 986 986 15 15 985 985 16 16 984 984 17 17 983 983 18 18 982 982 19 19 981 981 20 20 980 980 21 21 979 979 22 22 978 978 23...
result:
ok Correct. (1 test case)
Test #23:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
1000 132 993
output:
Yes 999 1 1 999 999 2 2 998 998 3 3 997 997 4 4 996 996 5 5 995 995 6 6 994 994 7 7 993 993 8 8 992 992 9 9 991 991 10 10 990 990 11 11 989 989 12 12 988 988 13 13 987 987 14 14 986 986 15 15 985 985 16 16 984 984 17 17 983 983 18 18 982 982 19 19 981 981 20 20 980 980 21 21 979 979 22 22 978 978 23...
result:
ok Correct. (1 test case)
Test #24:
score: 0
Accepted
time: 1ms
memory: 3660kb
input:
1000 703 499
output:
Yes 999 1 1 999 999 2 2 998 998 3 3 997 997 4 4 996 996 5 5 995 995 6 6 994 994 7 7 993 993 8 8 992 992 9 9 991 991 10 10 990 990 11 11 989 989 12 12 988 988 13 13 987 987 14 14 986 986 15 15 985 985 16 16 984 984 17 17 983 983 18 18 982 982 19 19 981 981 20 20 980 980 21 21 979 979 22 22 978 978 23...
result:
ok Correct. (1 test case)
Test #25:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
1000 910 298
output:
Yes 999 1 1 999 999 2 2 998 998 3 3 997 997 4 4 996 996 5 5 995 995 6 6 994 994 7 7 993 993 8 8 992 992 9 9 991 991 10 10 990 990 11 11 989 989 12 12 988 988 13 13 987 987 14 14 986 986 15 15 985 985 16 16 984 984 17 17 983 983 18 18 982 982 19 19 981 981 20 20 980 980 21 21 979 979 22 22 978 978 23...
result:
ok Correct. (1 test case)
Test #26:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
1000 171 322
output:
Yes 999 1 1 999 999 2 2 998 998 3 3 997 997 4 4 996 996 5 5 995 995 6 6 994 994 7 7 993 993 8 8 992 992 9 9 991 991 10 10 990 990 11 11 989 989 12 12 988 988 13 13 987 987 14 14 986 986 15 15 985 985 16 16 984 984 17 17 983 983 18 18 982 982 19 19 981 981 20 20 980 980 21 21 979 979 22 22 978 978 23...
result:
ok Correct. (1 test case)
Test #27:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
1000 1 1
output:
Yes 999 1000 1000 -999 -999 999 999 -998 -998 998 998 -997 -997 997 997 -996 -996 996 996 -995 -995 995 995 -994 -994 994 994 -993 -993 993 993 -992 -992 992 992 -991 -991 991 991 -990 -990 990 990 -989 -989 989 989 -988 -988 988 988 -987 -987 987 987 -986 -986 986 986 -985 -985 985 985 -984 -984 98...
result:
ok Correct. (1 test case)
Test #28:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
1000 480 1
output:
Yes 999 1 1000 999 -999 2 999 998 -998 3 998 997 -997 4 997 996 -996 5 996 995 -995 6 995 994 -994 7 994 993 -993 8 993 992 -992 9 992 991 -991 10 991 990 -990 11 990 989 -989 12 989 988 -988 13 988 987 -987 14 987 986 -986 15 986 985 -985 16 985 984 -984 17 984 983 -983 18 983 982 -982 19 982 981 -...
result:
ok Correct. (1 test case)
Test #29:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
1000 1000 1
output:
Yes 999 1 1000 999 -999 2 999 998 -998 3 998 997 -997 4 997 996 -996 5 996 995 -995 6 995 994 -994 7 994 993 -993 8 993 992 -992 9 992 991 -991 10 991 990 -990 11 990 989 -989 12 989 988 -988 13 988 987 -987 14 987 986 -986 15 986 985 -985 16 985 984 -984 17 984 983 -983 18 983 982 -982 19 982 981 -...
result:
ok Correct. (1 test case)
Test #30:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
1000 1 339
output:
Yes 999 1000 1 -999 999 999 2 -998 998 998 3 -997 997 997 4 -996 996 996 5 -995 995 995 6 -994 994 994 7 -993 993 993 8 -992 992 992 9 -991 991 991 10 -990 990 990 11 -989 989 989 12 -988 988 988 13 -987 987 987 14 -986 986 986 15 -985 985 985 16 -984 984 984 17 -983 983 983 18 -982 982 982 19 -981 ...
result:
ok Correct. (1 test case)
Test #31:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
1000 1000 161
output:
Yes 999 1 1 999 999 2 2 998 998 3 3 997 997 4 4 996 996 5 5 995 995 6 6 994 994 7 7 993 993 8 8 992 992 9 9 991 991 10 10 990 990 11 11 989 989 12 12 988 988 13 13 987 987 14 14 986 986 15 15 985 985 16 16 984 984 17 17 983 983 18 18 982 982 19 19 981 981 20 20 980 980 21 21 979 979 22 22 978 978 23...
result:
ok Correct. (1 test case)
Test #32:
score: 0
Accepted
time: 1ms
memory: 3888kb
input:
1000 1 1000
output:
Yes 999 1000 1 -999 999 999 2 -998 998 998 3 -997 997 997 4 -996 996 996 5 -995 995 995 6 -994 994 994 7 -993 993 993 8 -992 992 992 9 -991 991 991 10 -990 990 990 11 -989 989 989 12 -988 988 988 13 -987 987 987 14 -986 986 986 15 -985 985 985 16 -984 984 984 17 -983 983 983 18 -982 982 982 19 -981 ...
result:
ok Correct. (1 test case)
Test #33:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
1000 759 1000
output:
Yes 999 1 1 999 999 2 2 998 998 3 3 997 997 4 4 996 996 5 5 995 995 6 6 994 994 7 7 993 993 8 8 992 992 9 9 991 991 10 10 990 990 11 11 989 989 12 12 988 988 13 13 987 987 14 14 986 986 15 15 985 985 16 16 984 984 17 17 983 983 18 18 982 982 19 19 981 981 20 20 980 980 21 21 979 979 22 22 978 978 23...
result:
ok Correct. (1 test case)
Test #34:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
1000 1000 1000
output:
Yes 999 1 1 999 999 2 2 998 998 3 3 997 997 4 4 996 996 5 5 995 995 6 6 994 994 7 7 993 993 8 8 992 992 9 9 991 991 10 10 990 990 11 11 989 989 12 12 988 988 13 13 987 987 14 14 986 986 15 15 985 985 16 16 984 984 17 17 983 983 18 18 982 982 19 19 981 981 20 20 980 980 21 21 979 979 22 22 978 978 23...
result:
ok Correct. (1 test case)
Test #35:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
2 1 1
output:
Yes 1 2 2 -1 -1
result:
ok Correct. (1 test case)
Test #36:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
2 1 2
output:
Yes 1 2 1 -1 1
result:
ok Correct. (1 test case)
Test #37:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
2 2 1
output:
Yes 1 1 2 1 -1
result:
ok Correct. (1 test case)
Test #38:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
2 2 2
output:
Yes 1 1 1 1 1
result:
ok Correct. (1 test case)
Test #39:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
810 114 514
output:
Yes 809 1 1 809 809 2 2 808 808 3 3 807 807 4 4 806 806 5 5 805 805 6 6 804 804 7 7 803 803 8 8 802 802 9 9 801 801 10 10 800 800 11 11 799 799 12 12 798 798 13 13 797 797 14 14 796 796 15 15 795 795 16 16 794 794 17 17 793 793 18 18 792 792 19 19 791 791 20 20 790 790 21 21 789 789 22 22 788 788 23...
result:
ok Correct. (1 test case)
Test #40:
score: 0
Accepted
time: 1ms
memory: 3664kb
input:
810 514 114
output:
Yes 809 1 1 809 809 2 2 808 808 3 3 807 807 4 4 806 806 5 5 805 805 6 6 804 804 7 7 803 803 8 8 802 802 9 9 801 801 10 10 800 800 11 11 799 799 12 12 798 798 13 13 797 797 14 14 796 796 15 15 795 795 16 16 794 794 17 17 793 793 18 18 792 792 19 19 791 791 20 20 790 790 21 21 789 789 22 22 788 788 23...
result:
ok Correct. (1 test case)