QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#695417 | #6677. Puzzle: Sashigane | 0x3fffffff | AC ✓ | 1ms | 3896kb | C++20 | 1.1kb | 2024-10-31 19:59:41 | 2024-10-31 19:59:45 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n, a, b;
cin >> n >> a >> b;
int u = a, d = a, l = b, r = b;
vector<array<int, 4>>ans;
for (int i = 1;i < n;i++) {
if (l > 1 and u > 1) {
l--, u--;
ans.push_back({ u,l,d - u,r - l });
}
if (l > 1 and d < n) {
l--, d++;
ans.push_back({ d,l,u - d,r - l });
}
if (r < n and u>1) {
u--;r++;
ans.push_back({ u,r,d - u,l - r });
}
if (r < n and d < n) {
r++;d++;
ans.push_back({ d,r,u - d,l - r });
}
}
cout << "Yes\n";
cout << ans.size() << "\n";
for (auto [x, y, z, d] : ans) {
cout << x << " " << y << " " << z << " " << d << "\n";
}
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int tt = 1;
#ifdef LOCAL
freopen("data.in", "r", stdin);
freopen("data.out", "w", stdout);
#endif
// cin >> tt;
while (tt--)
solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3616kb
input:
5 3 4
output:
Yes 4 2 3 1 1 4 2 -2 2 1 5 3 -3 5 1 -4 4
result:
ok Correct. (1 test case)
Test #2:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
1 1 1
output:
Yes 0
result:
ok Correct. (1 test case)
Test #3:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
3 2 3
output:
Yes 2 1 2 1 1 3 1 -2 2
result:
ok Correct. (1 test case)
Test #4:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
10 10 5
output:
Yes 9 9 4 1 1 8 6 2 -2 7 3 3 3 6 7 4 -4 5 2 5 5 4 8 6 -6 3 1 7 7 2 9 8 -8 1 10 9 -9
result:
ok Correct. (1 test case)
Test #5:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
10 5 7
output:
Yes 9 4 6 1 1 6 5 -2 2 3 8 3 -3 7 9 -4 -4 2 4 5 5 8 3 -6 6 1 10 7 -7 9 2 -8 8 10 1 -9 9
result:
ok Correct. (1 test case)
Test #6:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
10 9 2
output:
Yes 9 8 1 1 1 7 3 2 -2 10 4 -3 -3 6 5 4 -4 5 6 5 -5 4 7 6 -6 3 8 7 -7 2 9 8 -8 1 10 9 -9
result:
ok Correct. (1 test case)
Test #7:
score: 0
Accepted
time: 0ms
memory: 3476kb
input:
10 6 10
output:
Yes 9 5 9 1 1 7 8 -2 2 4 7 3 3 8 6 -4 4 3 5 5 5 9 4 -6 6 2 3 7 7 10 2 -8 8 1 1 9 9
result:
ok Correct. (1 test case)
Test #8:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
10 8 4
output:
Yes 9 7 3 1 1 9 2 -2 2 6 5 3 -3 10 6 -4 -4 5 1 5 5 4 7 6 -6 3 8 7 -7 2 9 8 -8 1 10 9 -9
result:
ok Correct. (1 test case)
Test #9:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
999 396 693
output:
Yes 998 395 692 1 1 397 691 -2 2 394 694 3 -3 398 695 -4 -4 393 690 5 5 399 689 -6 6 392 696 7 -7 400 697 -8 -8 391 688 9 9 401 687 -10 10 390 698 11 -11 402 699 -12 -12 389 686 13 13 403 685 -14 14 388 700 15 -15 404 701 -16 -16 387 684 17 17 405 683 -18 18 386 702 19 -19 406 703 -20 -20 385 682 21...
result:
ok Correct. (1 test case)
Test #10:
score: 0
Accepted
time: 1ms
memory: 3884kb
input:
999 963 827
output:
Yes 998 962 826 1 1 964 825 -2 2 961 828 3 -3 965 829 -4 -4 960 824 5 5 966 823 -6 6 959 830 7 -7 967 831 -8 -8 958 822 9 9 968 821 -10 10 957 832 11 -11 969 833 -12 -12 956 820 13 13 970 819 -14 14 955 834 15 -15 971 835 -16 -16 954 818 17 17 972 817 -18 18 953 836 19 -19 973 837 -20 -20 952 816 21...
result:
ok Correct. (1 test case)
Test #11:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
999 871 185
output:
Yes 998 870 184 1 1 872 183 -2 2 869 186 3 -3 873 187 -4 -4 868 182 5 5 874 181 -6 6 867 188 7 -7 875 189 -8 -8 866 180 9 9 876 179 -10 10 865 190 11 -11 877 191 -12 -12 864 178 13 13 878 177 -14 14 863 192 15 -15 879 193 -16 -16 862 176 17 17 880 175 -18 18 861 194 19 -19 881 195 -20 -20 860 174 21...
result:
ok Correct. (1 test case)
Test #12:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
999 787 812
output:
Yes 998 786 811 1 1 788 810 -2 2 785 813 3 -3 789 814 -4 -4 784 809 5 5 790 808 -6 6 783 815 7 -7 791 816 -8 -8 782 807 9 9 792 806 -10 10 781 817 11 -11 793 818 -12 -12 780 805 13 13 794 804 -14 14 779 819 15 -15 795 820 -16 -16 778 803 17 17 796 802 -18 18 777 821 19 -19 797 822 -20 -20 776 801 21...
result:
ok Correct. (1 test case)
Test #13:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
999 396 199
output:
Yes 998 395 198 1 1 397 197 -2 2 394 200 3 -3 398 201 -4 -4 393 196 5 5 399 195 -6 6 392 202 7 -7 400 203 -8 -8 391 194 9 9 401 193 -10 10 390 204 11 -11 402 205 -12 -12 389 192 13 13 403 191 -14 14 388 206 15 -15 404 207 -16 -16 387 190 17 17 405 189 -18 18 386 208 19 -19 406 209 -20 -20 385 188 21...
result:
ok Correct. (1 test case)
Test #14:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
999 1 1
output:
Yes 998 2 2 -1 -1 3 3 -2 -2 4 4 -3 -3 5 5 -4 -4 6 6 -5 -5 7 7 -6 -6 8 8 -7 -7 9 9 -8 -8 10 10 -9 -9 11 11 -10 -10 12 12 -11 -11 13 13 -12 -12 14 14 -13 -13 15 15 -14 -14 16 16 -15 -15 17 17 -16 -16 18 18 -17 -17 19 19 -18 -18 20 20 -19 -19 21 21 -20 -20 22 22 -21 -21 23 23 -22 -22 24 24 -23 -23 25 2...
result:
ok Correct. (1 test case)
Test #15:
score: 0
Accepted
time: 1ms
memory: 3852kb
input:
999 163 1
output:
Yes 998 162 2 1 -1 164 3 -2 -2 161 4 3 -3 165 5 -4 -4 160 6 5 -5 166 7 -6 -6 159 8 7 -7 167 9 -8 -8 158 10 9 -9 168 11 -10 -10 157 12 11 -11 169 13 -12 -12 156 14 13 -13 170 15 -14 -14 155 16 15 -15 171 17 -16 -16 154 18 17 -17 172 19 -18 -18 153 20 19 -19 173 21 -20 -20 152 22 21 -21 174 23 -22 -22...
result:
ok Correct. (1 test case)
Test #16:
score: 0
Accepted
time: 1ms
memory: 3716kb
input:
999 999 1
output:
Yes 998 998 2 1 -1 997 3 2 -2 996 4 3 -3 995 5 4 -4 994 6 5 -5 993 7 6 -6 992 8 7 -7 991 9 8 -8 990 10 9 -9 989 11 10 -10 988 12 11 -11 987 13 12 -12 986 14 13 -13 985 15 14 -14 984 16 15 -15 983 17 16 -16 982 18 17 -17 981 19 18 -18 980 20 19 -19 979 21 20 -20 978 22 21 -21 977 23 22 -22 976 24 23 ...
result:
ok Correct. (1 test case)
Test #17:
score: 0
Accepted
time: 1ms
memory: 3484kb
input:
999 1 969
output:
Yes 998 2 968 -1 1 3 970 -2 -2 4 967 -3 3 5 971 -4 -4 6 966 -5 5 7 972 -6 -6 8 965 -7 7 9 973 -8 -8 10 964 -9 9 11 974 -10 -10 12 963 -11 11 13 975 -12 -12 14 962 -13 13 15 976 -14 -14 16 961 -15 15 17 977 -16 -16 18 960 -17 17 19 978 -18 -18 20 959 -19 19 21 979 -20 -20 22 958 -21 21 23 980 -22 -22...
result:
ok Correct. (1 test case)
Test #18:
score: 0
Accepted
time: 1ms
memory: 3892kb
input:
999 999 780
output:
Yes 998 998 779 1 1 997 781 2 -2 996 778 3 3 995 782 4 -4 994 777 5 5 993 783 6 -6 992 776 7 7 991 784 8 -8 990 775 9 9 989 785 10 -10 988 774 11 11 987 786 12 -12 986 773 13 13 985 787 14 -14 984 772 15 15 983 788 16 -16 982 771 17 17 981 789 18 -18 980 770 19 19 979 790 20 -20 978 769 21 21 977 79...
result:
ok Correct. (1 test case)
Test #19:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
999 1 999
output:
Yes 998 2 998 -1 1 3 997 -2 2 4 996 -3 3 5 995 -4 4 6 994 -5 5 7 993 -6 6 8 992 -7 7 9 991 -8 8 10 990 -9 9 11 989 -10 10 12 988 -11 11 13 987 -12 12 14 986 -13 13 15 985 -14 14 16 984 -15 15 17 983 -16 16 18 982 -17 17 19 981 -18 18 20 980 -19 19 21 979 -20 20 22 978 -21 21 23 977 -22 22 24 976 -23...
result:
ok Correct. (1 test case)
Test #20:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
999 686 999
output:
Yes 998 685 998 1 1 687 997 -2 2 684 996 3 3 688 995 -4 4 683 994 5 5 689 993 -6 6 682 992 7 7 690 991 -8 8 681 990 9 9 691 989 -10 10 680 988 11 11 692 987 -12 12 679 986 13 13 693 985 -14 14 678 984 15 15 694 983 -16 16 677 982 17 17 695 981 -18 18 676 980 19 19 696 979 -20 20 675 978 21 21 697 97...
result:
ok Correct. (1 test case)
Test #21:
score: 0
Accepted
time: 1ms
memory: 3480kb
input:
999 999 999
output:
Yes 998 998 998 1 1 997 997 2 2 996 996 3 3 995 995 4 4 994 994 5 5 993 993 6 6 992 992 7 7 991 991 8 8 990 990 9 9 989 989 10 10 988 988 11 11 987 987 12 12 986 986 13 13 985 985 14 14 984 984 15 15 983 983 16 16 982 982 17 17 981 981 18 18 980 980 19 19 979 979 20 20 978 978 21 21 977 977 22 22 97...
result:
ok Correct. (1 test case)
Test #22:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
1000 757 728
output:
Yes 999 756 727 1 1 758 726 -2 2 755 729 3 -3 759 730 -4 -4 754 725 5 5 760 724 -6 6 753 731 7 -7 761 732 -8 -8 752 723 9 9 762 722 -10 10 751 733 11 -11 763 734 -12 -12 750 721 13 13 764 720 -14 14 749 735 15 -15 765 736 -16 -16 748 719 17 17 766 718 -18 18 747 737 19 -19 767 738 -20 -20 746 717 21...
result:
ok Correct. (1 test case)
Test #23:
score: 0
Accepted
time: 1ms
memory: 3848kb
input:
1000 132 993
output:
Yes 999 131 992 1 1 133 991 -2 2 130 994 3 -3 134 995 -4 -4 129 990 5 5 135 989 -6 6 128 996 7 -7 136 997 -8 -8 127 988 9 9 137 987 -10 10 126 998 11 -11 138 999 -12 -12 125 986 13 13 139 985 -14 14 124 1000 15 -15 123 984 16 16 140 983 -17 17 122 982 18 18 141 981 -19 19 121 980 20 20 142 979 -21 2...
result:
ok Correct. (1 test case)
Test #24:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
1000 703 499
output:
Yes 999 702 498 1 1 704 497 -2 2 701 500 3 -3 705 501 -4 -4 700 496 5 5 706 495 -6 6 699 502 7 -7 707 503 -8 -8 698 494 9 9 708 493 -10 10 697 504 11 -11 709 505 -12 -12 696 492 13 13 710 491 -14 14 695 506 15 -15 711 507 -16 -16 694 490 17 17 712 489 -18 18 693 508 19 -19 713 509 -20 -20 692 488 21...
result:
ok Correct. (1 test case)
Test #25:
score: 0
Accepted
time: 1ms
memory: 3848kb
input:
1000 910 298
output:
Yes 999 909 297 1 1 911 296 -2 2 908 299 3 -3 912 300 -4 -4 907 295 5 5 913 294 -6 6 906 301 7 -7 914 302 -8 -8 905 293 9 9 915 292 -10 10 904 303 11 -11 916 304 -12 -12 903 291 13 13 917 290 -14 14 902 305 15 -15 918 306 -16 -16 901 289 17 17 919 288 -18 18 900 307 19 -19 920 308 -20 -20 899 287 21...
result:
ok Correct. (1 test case)
Test #26:
score: 0
Accepted
time: 1ms
memory: 3844kb
input:
1000 171 322
output:
Yes 999 170 321 1 1 172 320 -2 2 169 323 3 -3 173 324 -4 -4 168 319 5 5 174 318 -6 6 167 325 7 -7 175 326 -8 -8 166 317 9 9 176 316 -10 10 165 327 11 -11 177 328 -12 -12 164 315 13 13 178 314 -14 14 163 329 15 -15 179 330 -16 -16 162 313 17 17 180 312 -18 18 161 331 19 -19 181 332 -20 -20 160 311 21...
result:
ok Correct. (1 test case)
Test #27:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
1000 1 1
output:
Yes 999 2 2 -1 -1 3 3 -2 -2 4 4 -3 -3 5 5 -4 -4 6 6 -5 -5 7 7 -6 -6 8 8 -7 -7 9 9 -8 -8 10 10 -9 -9 11 11 -10 -10 12 12 -11 -11 13 13 -12 -12 14 14 -13 -13 15 15 -14 -14 16 16 -15 -15 17 17 -16 -16 18 18 -17 -17 19 19 -18 -18 20 20 -19 -19 21 21 -20 -20 22 22 -21 -21 23 23 -22 -22 24 24 -23 -23 25 2...
result:
ok Correct. (1 test case)
Test #28:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
1000 480 1
output:
Yes 999 479 2 1 -1 481 3 -2 -2 478 4 3 -3 482 5 -4 -4 477 6 5 -5 483 7 -6 -6 476 8 7 -7 484 9 -8 -8 475 10 9 -9 485 11 -10 -10 474 12 11 -11 486 13 -12 -12 473 14 13 -13 487 15 -14 -14 472 16 15 -15 488 17 -16 -16 471 18 17 -17 489 19 -18 -18 470 20 19 -19 490 21 -20 -20 469 22 21 -21 491 23 -22 -22...
result:
ok Correct. (1 test case)
Test #29:
score: 0
Accepted
time: 1ms
memory: 3660kb
input:
1000 1000 1
output:
Yes 999 999 2 1 -1 998 3 2 -2 997 4 3 -3 996 5 4 -4 995 6 5 -5 994 7 6 -6 993 8 7 -7 992 9 8 -8 991 10 9 -9 990 11 10 -10 989 12 11 -11 988 13 12 -12 987 14 13 -13 986 15 14 -14 985 16 15 -15 984 17 16 -16 983 18 17 -17 982 19 18 -18 981 20 19 -19 980 21 20 -20 979 22 21 -21 978 23 22 -22 977 24 23 ...
result:
ok Correct. (1 test case)
Test #30:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
1000 1 339
output:
Yes 999 2 338 -1 1 3 340 -2 -2 4 337 -3 3 5 341 -4 -4 6 336 -5 5 7 342 -6 -6 8 335 -7 7 9 343 -8 -8 10 334 -9 9 11 344 -10 -10 12 333 -11 11 13 345 -12 -12 14 332 -13 13 15 346 -14 -14 16 331 -15 15 17 347 -16 -16 18 330 -17 17 19 348 -18 -18 20 329 -19 19 21 349 -20 -20 22 328 -21 21 23 350 -22 -22...
result:
ok Correct. (1 test case)
Test #31:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
1000 1000 161
output:
Yes 999 999 160 1 1 998 162 2 -2 997 159 3 3 996 163 4 -4 995 158 5 5 994 164 6 -6 993 157 7 7 992 165 8 -8 991 156 9 9 990 166 10 -10 989 155 11 11 988 167 12 -12 987 154 13 13 986 168 14 -14 985 153 15 15 984 169 16 -16 983 152 17 17 982 170 18 -18 981 151 19 19 980 171 20 -20 979 150 21 21 978 17...
result:
ok Correct. (1 test case)
Test #32:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
1000 1 1000
output:
Yes 999 2 999 -1 1 3 998 -2 2 4 997 -3 3 5 996 -4 4 6 995 -5 5 7 994 -6 6 8 993 -7 7 9 992 -8 8 10 991 -9 9 11 990 -10 10 12 989 -11 11 13 988 -12 12 14 987 -13 13 15 986 -14 14 16 985 -15 15 17 984 -16 16 18 983 -17 17 19 982 -18 18 20 981 -19 19 21 980 -20 20 22 979 -21 21 23 978 -22 22 24 977 -23...
result:
ok Correct. (1 test case)
Test #33:
score: 0
Accepted
time: 1ms
memory: 3884kb
input:
1000 759 1000
output:
Yes 999 758 999 1 1 760 998 -2 2 757 997 3 3 761 996 -4 4 756 995 5 5 762 994 -6 6 755 993 7 7 763 992 -8 8 754 991 9 9 764 990 -10 10 753 989 11 11 765 988 -12 12 752 987 13 13 766 986 -14 14 751 985 15 15 767 984 -16 16 750 983 17 17 768 982 -18 18 749 981 19 19 769 980 -20 20 748 979 21 21 770 97...
result:
ok Correct. (1 test case)
Test #34:
score: 0
Accepted
time: 1ms
memory: 3844kb
input:
1000 1000 1000
output:
Yes 999 999 999 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 97...
result:
ok Correct. (1 test case)
Test #35:
score: 0
Accepted
time: 0ms
memory: 3816kb
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: 3664kb
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: 3564kb
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: 3548kb
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: 3896kb
input:
810 114 514
output:
Yes 809 113 513 1 1 115 512 -2 2 112 515 3 -3 116 516 -4 -4 111 511 5 5 117 510 -6 6 110 517 7 -7 118 518 -8 -8 109 509 9 9 119 508 -10 10 108 519 11 -11 120 520 -12 -12 107 507 13 13 121 506 -14 14 106 521 15 -15 122 522 -16 -16 105 505 17 17 123 504 -18 18 104 523 19 -19 124 524 -20 -20 103 503 21...
result:
ok Correct. (1 test case)
Test #40:
score: 0
Accepted
time: 1ms
memory: 3884kb
input:
810 514 114
output:
Yes 809 513 113 1 1 515 112 -2 2 512 115 3 -3 516 116 -4 -4 511 111 5 5 517 110 -6 6 510 117 7 -7 518 118 -8 -8 509 109 9 9 519 108 -10 10 508 119 11 -11 520 120 -12 -12 507 107 13 13 521 106 -14 14 506 121 15 -15 522 122 -16 -16 505 105 17 17 523 104 -18 18 504 123 19 -19 524 124 -20 -20 503 103 21...
result:
ok Correct. (1 test case)