QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#382125#6677. Puzzle: Sashiganekevinyang#AC ✓1ms3880kbC++17971b2024-04-08 03:13:502024-04-08 03:13:50

Judging History

你现在查看的是最新测评结果

  • [2024-04-08 03:13:50]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3880kb
  • [2024-04-08 03:13:50]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
struct node{
    int a,b,c,d;
};
signed main(){
    cin.tie(nullptr)->sync_with_stdio(false);
    int n,x,y;
    cin >> n >> x >> y;
    int sx = x;
    int sy = y;
    vector<node>ans;
    int cur = 1;
    while(x > 1 && y < n){
        x--; y++;
        ans.push_back({x,y,cur,-cur});
        cur++;
    }
    if(x == 1){
        while(y < n){
            y++;
            sx++;
            ans.push_back({sx,y,-cur,-cur});
            cur++;
        }
    }
    else{
        while(x > 1){
            x--; sy--;
            ans.push_back({x,sy,cur,cur});
            cur++;
        }
    }
    while(cur < n){
        ans.push_back({cur+1,n-cur,-cur,cur});
        cur++;
    }
    cout << "Yes\n";
    cout << ans.size() << '\n';
    for(auto nxt: ans){
        cout << nxt.a << ' ' << nxt.b << ' ' << nxt.c << ' ' << nxt.d << '\n';
    }
    return 0;
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3560kb

input:

5 3 4

output:

Yes
4
2 5 1 -1
1 3 2 2
4 2 -3 3
5 1 -4 4

result:

ok Correct. (1 test case)

Test #2:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

1 1 1

output:

Yes
0

result:

ok Correct. (1 test case)

Test #3:

score: 0
Accepted
time: 0ms
memory: 3572kb

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: 3572kb

input:

10 10 5

output:

Yes
9
9 6 1 -1
8 7 2 -2
7 8 3 -3
6 9 4 -4
5 10 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 #5:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

10 5 7

output:

Yes
9
4 8 1 -1
3 9 2 -2
2 10 3 -3
1 6 4 4
6 5 -5 5
7 4 -6 6
8 3 -7 7
9 2 -8 8
10 1 -9 9

result:

ok Correct. (1 test case)

Test #6:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

10 9 2

output:

Yes
9
8 3 1 -1
7 4 2 -2
6 5 3 -3
5 6 4 -4
4 7 5 -5
3 8 6 -6
2 9 7 -7
1 10 8 -8
10 1 -9 9

result:

ok Correct. (1 test case)

Test #7:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

10 6 10

output:

Yes
9
5 9 1 1
4 8 2 2
3 7 3 3
2 6 4 4
1 5 5 5
7 4 -6 6
8 3 -7 7
9 2 -8 8
10 1 -9 9

result:

ok Correct. (1 test case)

Test #8:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

10 8 4

output:

Yes
9
7 5 1 -1
6 6 2 -2
5 7 3 -3
4 8 4 -4
3 9 5 -5
2 10 6 -6
1 3 7 7
9 2 -8 8
10 1 -9 9

result:

ok Correct. (1 test case)

Test #9:

score: 0
Accepted
time: 1ms
memory: 3768kb

input:

999 396 693

output:

Yes
998
395 694 1 -1
394 695 2 -2
393 696 3 -3
392 697 4 -4
391 698 5 -5
390 699 6 -6
389 700 7 -7
388 701 8 -8
387 702 9 -9
386 703 10 -10
385 704 11 -11
384 705 12 -12
383 706 13 -13
382 707 14 -14
381 708 15 -15
380 709 16 -16
379 710 17 -17
378 711 18 -18
377 712 19 -19
376 713 20 -20
375 714 21...

result:

ok Correct. (1 test case)

Test #10:

score: 0
Accepted
time: 1ms
memory: 3608kb

input:

999 963 827

output:

Yes
998
962 828 1 -1
961 829 2 -2
960 830 3 -3
959 831 4 -4
958 832 5 -5
957 833 6 -6
956 834 7 -7
955 835 8 -8
954 836 9 -9
953 837 10 -10
952 838 11 -11
951 839 12 -12
950 840 13 -13
949 841 14 -14
948 842 15 -15
947 843 16 -16
946 844 17 -17
945 845 18 -18
944 846 19 -19
943 847 20 -20
942 848 21...

result:

ok Correct. (1 test case)

Test #11:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

999 871 185

output:

Yes
998
870 186 1 -1
869 187 2 -2
868 188 3 -3
867 189 4 -4
866 190 5 -5
865 191 6 -6
864 192 7 -7
863 193 8 -8
862 194 9 -9
861 195 10 -10
860 196 11 -11
859 197 12 -12
858 198 13 -13
857 199 14 -14
856 200 15 -15
855 201 16 -16
854 202 17 -17
853 203 18 -18
852 204 19 -19
851 205 20 -20
850 206 21...

result:

ok Correct. (1 test case)

Test #12:

score: 0
Accepted
time: 1ms
memory: 3556kb

input:

999 787 812

output:

Yes
998
786 813 1 -1
785 814 2 -2
784 815 3 -3
783 816 4 -4
782 817 5 -5
781 818 6 -6
780 819 7 -7
779 820 8 -8
778 821 9 -9
777 822 10 -10
776 823 11 -11
775 824 12 -12
774 825 13 -13
773 826 14 -14
772 827 15 -15
771 828 16 -16
770 829 17 -17
769 830 18 -18
768 831 19 -19
767 832 20 -20
766 833 21...

result:

ok Correct. (1 test case)

Test #13:

score: 0
Accepted
time: 1ms
memory: 3600kb

input:

999 396 199

output:

Yes
998
395 200 1 -1
394 201 2 -2
393 202 3 -3
392 203 4 -4
391 204 5 -5
390 205 6 -6
389 206 7 -7
388 207 8 -8
387 208 9 -9
386 209 10 -10
385 210 11 -11
384 211 12 -12
383 212 13 -13
382 213 14 -14
381 214 15 -15
380 215 16 -16
379 216 17 -17
378 217 18 -18
377 218 19 -19
376 219 20 -20
375 220 21...

result:

ok Correct. (1 test case)

Test #14:

score: 0
Accepted
time: 1ms
memory: 3820kb

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: 3664kb

input:

999 163 1

output:

Yes
998
162 2 1 -1
161 3 2 -2
160 4 3 -3
159 5 4 -4
158 6 5 -5
157 7 6 -6
156 8 7 -7
155 9 8 -8
154 10 9 -9
153 11 10 -10
152 12 11 -11
151 13 12 -12
150 14 13 -13
149 15 14 -14
148 16 15 -15
147 17 16 -16
146 18 17 -17
145 19 18 -18
144 20 19 -19
143 21 20 -20
142 22 21 -21
141 23 22 -22
140 24 23 ...

result:

ok Correct. (1 test case)

Test #16:

score: 0
Accepted
time: 1ms
memory: 3596kb

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: 0ms
memory: 3616kb

input:

999 1 969

output:

Yes
998
2 970 -1 -1
3 971 -2 -2
4 972 -3 -3
5 973 -4 -4
6 974 -5 -5
7 975 -6 -6
8 976 -7 -7
9 977 -8 -8
10 978 -9 -9
11 979 -10 -10
12 980 -11 -11
13 981 -12 -12
14 982 -13 -13
15 983 -14 -14
16 984 -15 -15
17 985 -16 -16
18 986 -17 -17
19 987 -18 -18
20 988 -19 -19
21 989 -20 -20
22 990 -21 -21
23 ...

result:

ok Correct. (1 test case)

Test #18:

score: 0
Accepted
time: 1ms
memory: 3676kb

input:

999 999 780

output:

Yes
998
998 781 1 -1
997 782 2 -2
996 783 3 -3
995 784 4 -4
994 785 5 -5
993 786 6 -6
992 787 7 -7
991 788 8 -8
990 789 9 -9
989 790 10 -10
988 791 11 -11
987 792 12 -12
986 793 13 -13
985 794 14 -14
984 795 15 -15
983 796 16 -16
982 797 17 -17
981 798 18 -18
980 799 19 -19
979 800 20 -20
978 801 21...

result:

ok Correct. (1 test case)

Test #19:

score: 0
Accepted
time: 0ms
memory: 3524kb

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: 0ms
memory: 3528kb

input:

999 686 999

output:

Yes
998
685 998 1 1
684 997 2 2
683 996 3 3
682 995 4 4
681 994 5 5
680 993 6 6
679 992 7 7
678 991 8 8
677 990 9 9
676 989 10 10
675 988 11 11
674 987 12 12
673 986 13 13
672 985 14 14
671 984 15 15
670 983 16 16
669 982 17 17
668 981 18 18
667 980 19 19
666 979 20 20
665 978 21 21
664 977 22 22
66...

result:

ok Correct. (1 test case)

Test #21:

score: 0
Accepted
time: 1ms
memory: 3820kb

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: 3876kb

input:

1000 757 728

output:

Yes
999
756 729 1 -1
755 730 2 -2
754 731 3 -3
753 732 4 -4
752 733 5 -5
751 734 6 -6
750 735 7 -7
749 736 8 -8
748 737 9 -9
747 738 10 -10
746 739 11 -11
745 740 12 -12
744 741 13 -13
743 742 14 -14
742 743 15 -15
741 744 16 -16
740 745 17 -17
739 746 18 -18
738 747 19 -19
737 748 20 -20
736 749 21...

result:

ok Correct. (1 test case)

Test #23:

score: 0
Accepted
time: 1ms
memory: 3600kb

input:

1000 132 993

output:

Yes
999
131 994 1 -1
130 995 2 -2
129 996 3 -3
128 997 4 -4
127 998 5 -5
126 999 6 -6
125 1000 7 -7
124 992 8 8
123 991 9 9
122 990 10 10
121 989 11 11
120 988 12 12
119 987 13 13
118 986 14 14
117 985 15 15
116 984 16 16
115 983 17 17
114 982 18 18
113 981 19 19
112 980 20 20
111 979 21 21
110 978 ...

result:

ok Correct. (1 test case)

Test #24:

score: 0
Accepted
time: 1ms
memory: 3880kb

input:

1000 703 499

output:

Yes
999
702 500 1 -1
701 501 2 -2
700 502 3 -3
699 503 4 -4
698 504 5 -5
697 505 6 -6
696 506 7 -7
695 507 8 -8
694 508 9 -9
693 509 10 -10
692 510 11 -11
691 511 12 -12
690 512 13 -13
689 513 14 -14
688 514 15 -15
687 515 16 -16
686 516 17 -17
685 517 18 -18
684 518 19 -19
683 519 20 -20
682 520 21...

result:

ok Correct. (1 test case)

Test #25:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

1000 910 298

output:

Yes
999
909 299 1 -1
908 300 2 -2
907 301 3 -3
906 302 4 -4
905 303 5 -5
904 304 6 -6
903 305 7 -7
902 306 8 -8
901 307 9 -9
900 308 10 -10
899 309 11 -11
898 310 12 -12
897 311 13 -13
896 312 14 -14
895 313 15 -15
894 314 16 -16
893 315 17 -17
892 316 18 -18
891 317 19 -19
890 318 20 -20
889 319 21...

result:

ok Correct. (1 test case)

Test #26:

score: 0
Accepted
time: 1ms
memory: 3512kb

input:

1000 171 322

output:

Yes
999
170 323 1 -1
169 324 2 -2
168 325 3 -3
167 326 4 -4
166 327 5 -5
165 328 6 -6
164 329 7 -7
163 330 8 -8
162 331 9 -9
161 332 10 -10
160 333 11 -11
159 334 12 -12
158 335 13 -13
157 336 14 -14
156 337 15 -15
155 338 16 -16
154 339 17 -17
153 340 18 -18
152 341 19 -19
151 342 20 -20
150 343 21...

result:

ok Correct. (1 test case)

Test #27:

score: 0
Accepted
time: 1ms
memory: 3876kb

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: 3836kb

input:

1000 480 1

output:

Yes
999
479 2 1 -1
478 3 2 -2
477 4 3 -3
476 5 4 -4
475 6 5 -5
474 7 6 -6
473 8 7 -7
472 9 8 -8
471 10 9 -9
470 11 10 -10
469 12 11 -11
468 13 12 -12
467 14 13 -13
466 15 14 -14
465 16 15 -15
464 17 16 -16
463 18 17 -17
462 19 18 -18
461 20 19 -19
460 21 20 -20
459 22 21 -21
458 23 22 -22
457 24 23 ...

result:

ok Correct. (1 test case)

Test #29:

score: 0
Accepted
time: 0ms
memory: 3644kb

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: 3836kb

input:

1000 1 339

output:

Yes
999
2 340 -1 -1
3 341 -2 -2
4 342 -3 -3
5 343 -4 -4
6 344 -5 -5
7 345 -6 -6
8 346 -7 -7
9 347 -8 -8
10 348 -9 -9
11 349 -10 -10
12 350 -11 -11
13 351 -12 -12
14 352 -13 -13
15 353 -14 -14
16 354 -15 -15
17 355 -16 -16
18 356 -17 -17
19 357 -18 -18
20 358 -19 -19
21 359 -20 -20
22 360 -21 -21
23 ...

result:

ok Correct. (1 test case)

Test #31:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

1000 1000 161

output:

Yes
999
999 162 1 -1
998 163 2 -2
997 164 3 -3
996 165 4 -4
995 166 5 -5
994 167 6 -6
993 168 7 -7
992 169 8 -8
991 170 9 -9
990 171 10 -10
989 172 11 -11
988 173 12 -12
987 174 13 -13
986 175 14 -14
985 176 15 -15
984 177 16 -16
983 178 17 -17
982 179 18 -18
981 180 19 -19
980 181 20 -20
979 182 21...

result:

ok Correct. (1 test case)

Test #32:

score: 0
Accepted
time: 1ms
memory: 3608kb

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: 3636kb

input:

1000 759 1000

output:

Yes
999
758 999 1 1
757 998 2 2
756 997 3 3
755 996 4 4
754 995 5 5
753 994 6 6
752 993 7 7
751 992 8 8
750 991 9 9
749 990 10 10
748 989 11 11
747 988 12 12
746 987 13 13
745 986 14 14
744 985 15 15
743 984 16 16
742 983 17 17
741 982 18 18
740 981 19 19
739 980 20 20
738 979 21 21
737 978 22 22
73...

result:

ok Correct. (1 test case)

Test #34:

score: 0
Accepted
time: 1ms
memory: 3664kb

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: 3544kb

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: 3536kb

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: 3460kb

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: 3608kb

input:

2 2 2

output:

Yes
1
1 1 1 1

result:

ok Correct. (1 test case)

Test #39:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

810 114 514

output:

Yes
809
113 515 1 -1
112 516 2 -2
111 517 3 -3
110 518 4 -4
109 519 5 -5
108 520 6 -6
107 521 7 -7
106 522 8 -8
105 523 9 -9
104 524 10 -10
103 525 11 -11
102 526 12 -12
101 527 13 -13
100 528 14 -14
99 529 15 -15
98 530 16 -16
97 531 17 -17
96 532 18 -18
95 533 19 -19
94 534 20 -20
93 535 21 -21
92...

result:

ok Correct. (1 test case)

Test #40:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

810 514 114

output:

Yes
809
513 115 1 -1
512 116 2 -2
511 117 3 -3
510 118 4 -4
509 119 5 -5
508 120 6 -6
507 121 7 -7
506 122 8 -8
505 123 9 -9
504 124 10 -10
503 125 11 -11
502 126 12 -12
501 127 13 -13
500 128 14 -14
499 129 15 -15
498 130 16 -16
497 131 17 -17
496 132 18 -18
495 133 19 -19
494 134 20 -20
493 135 21...

result:

ok Correct. (1 test case)