QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#277337 | #6677. Puzzle: Sashigane | ucup-team191# | AC ✓ | 1ms | 3628kb | C++14 | 1.1kb | 2023-12-06 17:52:34 | 2023-12-06 17:52:34 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef pair <int, int> pi;
int n, cx, cy;
vector <pair <pi, pi> > sol;
int main () {
cin >> n >> cx >> cy;
int len = 1;
while (cx < n && cy > 1) {
cx++; cy--; len++;
sol.push_back({{cx, cy}, {-(len - 1), len - 1}});
}
if (cx == n) {
while (cy > 1) {
cy--; len++;
sol.push_back({{n + 1 - len, cy}, {len - 1, len - 1}});
}
} else if (cy == 1) {
while (cx < n) {
cx++; len++;
sol.push_back({{cx, len}, {-(len - 1), -(len - 1)}});
}
}
while (len < n) {
len++;
sol.push_back({{n + 1 - len, len}, {len - 1, -(len - 1)}});
}
cout << "Yes\n";
cout << sol.size() << '\n';
for (int i = 0; i < sol.size(); i++) {
int x = sol[i].first.first;
int y = sol[i].first.second;
int h = sol[i].second.first;
int w = sol[i].second.second;
cout << x << " " << y << " " << h << " " << w << '\n';
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3424kb
input:
5 3 4
output:
Yes 4 4 3 -1 1 5 2 -2 2 2 1 3 3 1 5 4 -4
result:
ok Correct. (1 test case)
Test #2:
score: 0
Accepted
time: 1ms
memory: 3380kb
input:
1 1 1
output:
Yes 0
result:
ok Correct. (1 test case)
Test #3:
score: 0
Accepted
time: 0ms
memory: 3384kb
input:
3 2 3
output:
Yes 2 3 2 -1 1 1 1 2 2
result:
ok Correct. (1 test case)
Test #4:
score: 0
Accepted
time: 0ms
memory: 3384kb
input:
10 10 5
output:
Yes 9 9 4 1 1 8 3 2 2 7 2 3 3 6 1 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 #5:
score: 0
Accepted
time: 0ms
memory: 3380kb
input:
10 5 7
output:
Yes 9 6 6 -1 1 7 5 -2 2 8 4 -3 3 9 3 -4 4 10 2 -5 5 4 1 6 6 3 8 7 -7 2 9 8 -8 1 10 9 -9
result:
ok Correct. (1 test case)
Test #6:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
10 9 2
output:
Yes 9 10 1 -1 1 8 3 2 -2 7 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: 3384kb
input:
10 6 10
output:
Yes 9 7 9 -1 1 8 8 -2 2 9 7 -3 3 10 6 -4 4 5 5 5 5 4 4 6 6 3 3 7 7 2 2 8 8 1 1 9 9
result:
ok Correct. (1 test case)
Test #8:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
10 8 4
output:
Yes 9 9 3 -1 1 10 2 -2 2 7 1 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 #9:
score: 0
Accepted
time: 1ms
memory: 3464kb
input:
999 396 693
output:
Yes 998 397 692 -1 1 398 691 -2 2 399 690 -3 3 400 689 -4 4 401 688 -5 5 402 687 -6 6 403 686 -7 7 404 685 -8 8 405 684 -9 9 406 683 -10 10 407 682 -11 11 408 681 -12 12 409 680 -13 13 410 679 -14 14 411 678 -15 15 412 677 -16 16 413 676 -17 17 414 675 -18 18 415 674 -19 19 416 673 -20 20 417 672 -2...
result:
ok Correct. (1 test case)
Test #10:
score: 0
Accepted
time: 0ms
memory: 3336kb
input:
999 963 827
output:
Yes 998 964 826 -1 1 965 825 -2 2 966 824 -3 3 967 823 -4 4 968 822 -5 5 969 821 -6 6 970 820 -7 7 971 819 -8 8 972 818 -9 9 973 817 -10 10 974 816 -11 11 975 815 -12 12 976 814 -13 13 977 813 -14 14 978 812 -15 15 979 811 -16 16 980 810 -17 17 981 809 -18 18 982 808 -19 19 983 807 -20 20 984 806 -2...
result:
ok Correct. (1 test case)
Test #11:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
999 871 185
output:
Yes 998 872 184 -1 1 873 183 -2 2 874 182 -3 3 875 181 -4 4 876 180 -5 5 877 179 -6 6 878 178 -7 7 879 177 -8 8 880 176 -9 9 881 175 -10 10 882 174 -11 11 883 173 -12 12 884 172 -13 13 885 171 -14 14 886 170 -15 15 887 169 -16 16 888 168 -17 17 889 167 -18 18 890 166 -19 19 891 165 -20 20 892 164 -2...
result:
ok Correct. (1 test case)
Test #12:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
999 787 812
output:
Yes 998 788 811 -1 1 789 810 -2 2 790 809 -3 3 791 808 -4 4 792 807 -5 5 793 806 -6 6 794 805 -7 7 795 804 -8 8 796 803 -9 9 797 802 -10 10 798 801 -11 11 799 800 -12 12 800 799 -13 13 801 798 -14 14 802 797 -15 15 803 796 -16 16 804 795 -17 17 805 794 -18 18 806 793 -19 19 807 792 -20 20 808 791 -2...
result:
ok Correct. (1 test case)
Test #13:
score: 0
Accepted
time: 1ms
memory: 3336kb
input:
999 396 199
output:
Yes 998 397 198 -1 1 398 197 -2 2 399 196 -3 3 400 195 -4 4 401 194 -5 5 402 193 -6 6 403 192 -7 7 404 191 -8 8 405 190 -9 9 406 189 -10 10 407 188 -11 11 408 187 -12 12 409 186 -13 13 410 185 -14 14 411 184 -15 15 412 183 -16 16 413 182 -17 17 414 181 -18 18 415 180 -19 19 416 179 -20 20 417 178 -2...
result:
ok Correct. (1 test case)
Test #14:
score: 0
Accepted
time: 1ms
memory: 3456kb
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: 3456kb
input:
999 163 1
output:
Yes 998 164 2 -1 -1 165 3 -2 -2 166 4 -3 -3 167 5 -4 -4 168 6 -5 -5 169 7 -6 -6 170 8 -7 -7 171 9 -8 -8 172 10 -9 -9 173 11 -10 -10 174 12 -11 -11 175 13 -12 -12 176 14 -13 -13 177 15 -14 -14 178 16 -15 -15 179 17 -16 -16 180 18 -17 -17 181 19 -18 -18 182 20 -19 -19 183 21 -20 -20 184 22 -21 -21 185...
result:
ok Correct. (1 test case)
Test #16:
score: 0
Accepted
time: 1ms
memory: 3460kb
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: 3456kb
input:
999 1 969
output:
Yes 998 2 968 -1 1 3 967 -2 2 4 966 -3 3 5 965 -4 4 6 964 -5 5 7 963 -6 6 8 962 -7 7 9 961 -8 8 10 960 -9 9 11 959 -10 10 12 958 -11 11 13 957 -12 12 14 956 -13 13 15 955 -14 14 16 954 -15 15 17 953 -16 16 18 952 -17 17 19 951 -18 18 20 950 -19 19 21 949 -20 20 22 948 -21 21 23 947 -22 22 24 946 -23...
result:
ok Correct. (1 test case)
Test #18:
score: 0
Accepted
time: 1ms
memory: 3336kb
input:
999 999 780
output:
Yes 998 998 779 1 1 997 778 2 2 996 777 3 3 995 776 4 4 994 775 5 5 993 774 6 6 992 773 7 7 991 772 8 8 990 771 9 9 989 770 10 10 988 769 11 11 987 768 12 12 986 767 13 13 985 766 14 14 984 765 15 15 983 764 16 16 982 763 17 17 981 762 18 18 980 761 19 19 979 760 20 20 978 759 21 21 977 758 22 22 97...
result:
ok Correct. (1 test case)
Test #19:
score: 0
Accepted
time: 1ms
memory: 3624kb
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: 3456kb
input:
999 686 999
output:
Yes 998 687 998 -1 1 688 997 -2 2 689 996 -3 3 690 995 -4 4 691 994 -5 5 692 993 -6 6 693 992 -7 7 694 991 -8 8 695 990 -9 9 696 989 -10 10 697 988 -11 11 698 987 -12 12 699 986 -13 13 700 985 -14 14 701 984 -15 15 702 983 -16 16 703 982 -17 17 704 981 -18 18 705 980 -19 19 706 979 -20 20 707 978 -2...
result:
ok Correct. (1 test case)
Test #21:
score: 0
Accepted
time: 1ms
memory: 3580kb
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: 3336kb
input:
1000 757 728
output:
Yes 999 758 727 -1 1 759 726 -2 2 760 725 -3 3 761 724 -4 4 762 723 -5 5 763 722 -6 6 764 721 -7 7 765 720 -8 8 766 719 -9 9 767 718 -10 10 768 717 -11 11 769 716 -12 12 770 715 -13 13 771 714 -14 14 772 713 -15 15 773 712 -16 16 774 711 -17 17 775 710 -18 18 776 709 -19 19 777 708 -20 20 778 707 -2...
result:
ok Correct. (1 test case)
Test #23:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
1000 132 993
output:
Yes 999 133 992 -1 1 134 991 -2 2 135 990 -3 3 136 989 -4 4 137 988 -5 5 138 987 -6 6 139 986 -7 7 140 985 -8 8 141 984 -9 9 142 983 -10 10 143 982 -11 11 144 981 -12 12 145 980 -13 13 146 979 -14 14 147 978 -15 15 148 977 -16 16 149 976 -17 17 150 975 -18 18 151 974 -19 19 152 973 -20 20 153 972 -2...
result:
ok Correct. (1 test case)
Test #24:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
1000 703 499
output:
Yes 999 704 498 -1 1 705 497 -2 2 706 496 -3 3 707 495 -4 4 708 494 -5 5 709 493 -6 6 710 492 -7 7 711 491 -8 8 712 490 -9 9 713 489 -10 10 714 488 -11 11 715 487 -12 12 716 486 -13 13 717 485 -14 14 718 484 -15 15 719 483 -16 16 720 482 -17 17 721 481 -18 18 722 480 -19 19 723 479 -20 20 724 478 -2...
result:
ok Correct. (1 test case)
Test #25:
score: 0
Accepted
time: 1ms
memory: 3404kb
input:
1000 910 298
output:
Yes 999 911 297 -1 1 912 296 -2 2 913 295 -3 3 914 294 -4 4 915 293 -5 5 916 292 -6 6 917 291 -7 7 918 290 -8 8 919 289 -9 9 920 288 -10 10 921 287 -11 11 922 286 -12 12 923 285 -13 13 924 284 -14 14 925 283 -15 15 926 282 -16 16 927 281 -17 17 928 280 -18 18 929 279 -19 19 930 278 -20 20 931 277 -2...
result:
ok Correct. (1 test case)
Test #26:
score: 0
Accepted
time: 1ms
memory: 3420kb
input:
1000 171 322
output:
Yes 999 172 321 -1 1 173 320 -2 2 174 319 -3 3 175 318 -4 4 176 317 -5 5 177 316 -6 6 178 315 -7 7 179 314 -8 8 180 313 -9 9 181 312 -10 10 182 311 -11 11 183 310 -12 12 184 309 -13 13 185 308 -14 14 186 307 -15 15 187 306 -16 16 188 305 -17 17 189 304 -18 18 190 303 -19 19 191 302 -20 20 192 301 -2...
result:
ok Correct. (1 test case)
Test #27:
score: 0
Accepted
time: 1ms
memory: 3420kb
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: 3468kb
input:
1000 480 1
output:
Yes 999 481 2 -1 -1 482 3 -2 -2 483 4 -3 -3 484 5 -4 -4 485 6 -5 -5 486 7 -6 -6 487 8 -7 -7 488 9 -8 -8 489 10 -9 -9 490 11 -10 -10 491 12 -11 -11 492 13 -12 -12 493 14 -13 -13 494 15 -14 -14 495 16 -15 -15 496 17 -16 -16 497 18 -17 -17 498 19 -18 -18 499 20 -19 -19 500 21 -20 -20 501 22 -21 -21 502...
result:
ok Correct. (1 test case)
Test #29:
score: 0
Accepted
time: 1ms
memory: 3400kb
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: 3464kb
input:
1000 1 339
output:
Yes 999 2 338 -1 1 3 337 -2 2 4 336 -3 3 5 335 -4 4 6 334 -5 5 7 333 -6 6 8 332 -7 7 9 331 -8 8 10 330 -9 9 11 329 -10 10 12 328 -11 11 13 327 -12 12 14 326 -13 13 15 325 -14 14 16 324 -15 15 17 323 -16 16 18 322 -17 17 19 321 -18 18 20 320 -19 19 21 319 -20 20 22 318 -21 21 23 317 -22 22 24 316 -23...
result:
ok Correct. (1 test case)
Test #31:
score: 0
Accepted
time: 1ms
memory: 3456kb
input:
1000 1000 161
output:
Yes 999 999 160 1 1 998 159 2 2 997 158 3 3 996 157 4 4 995 156 5 5 994 155 6 6 993 154 7 7 992 153 8 8 991 152 9 9 990 151 10 10 989 150 11 11 988 149 12 12 987 148 13 13 986 147 14 14 985 146 15 15 984 145 16 16 983 144 17 17 982 143 18 18 981 142 19 19 980 141 20 20 979 140 21 21 978 139 22 22 97...
result:
ok Correct. (1 test case)
Test #32:
score: 0
Accepted
time: 1ms
memory: 3404kb
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: 0ms
memory: 3452kb
input:
1000 759 1000
output:
Yes 999 760 999 -1 1 761 998 -2 2 762 997 -3 3 763 996 -4 4 764 995 -5 5 765 994 -6 6 766 993 -7 7 767 992 -8 8 768 991 -9 9 769 990 -10 10 770 989 -11 11 771 988 -12 12 772 987 -13 13 773 986 -14 14 774 985 -15 15 775 984 -16 16 776 983 -17 17 777 982 -18 18 778 981 -19 19 779 980 -20 20 780 979 -2...
result:
ok Correct. (1 test case)
Test #34:
score: 0
Accepted
time: 0ms
memory: 3452kb
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: 1ms
memory: 3604kb
input:
2 1 1
output:
Yes 1 2 2 -1 -1
result:
ok Correct. (1 test case)
Test #36:
score: 0
Accepted
time: 1ms
memory: 3432kb
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: 3372kb
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: 3412kb
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 115 513 -1 1 116 512 -2 2 117 511 -3 3 118 510 -4 4 119 509 -5 5 120 508 -6 6 121 507 -7 7 122 506 -8 8 123 505 -9 9 124 504 -10 10 125 503 -11 11 126 502 -12 12 127 501 -13 13 128 500 -14 14 129 499 -15 15 130 498 -16 16 131 497 -17 17 132 496 -18 18 133 495 -19 19 134 494 -20 20 135 493 -2...
result:
ok Correct. (1 test case)
Test #40:
score: 0
Accepted
time: 1ms
memory: 3512kb
input:
810 514 114
output:
Yes 809 515 113 -1 1 516 112 -2 2 517 111 -3 3 518 110 -4 4 519 109 -5 5 520 108 -6 6 521 107 -7 7 522 106 -8 8 523 105 -9 9 524 104 -10 10 525 103 -11 11 526 102 -12 12 527 101 -13 13 528 100 -14 14 529 99 -15 15 530 98 -16 16 531 97 -17 17 532 96 -18 18 533 95 -19 19 534 94 -20 20 535 93 -21 21 53...
result:
ok Correct. (1 test case)