QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#668708 | #7619. Make SYSU Great Again I | nefugzh | AC ✓ | 67ms | 3928kb | C++17 | 2.1kb | 2024-10-23 15:36:02 | 2024-10-23 15:36:02 |
Judging History
answer
//#pragma GCC optimize(2)
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
#define INF 0x3f3f3f3f
#define lowbit(x) (x&(-x))
#define Mid (l+r)/2
#define Ls i<<1
#define Rs i<<1|1
#define Lson Ls,l,Mid
#define Rson Rs,Mid+1,r
#define For(i,a,b) for(int i=a;i<=b;i++)
#define FOr(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
//using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
//tree<ll,null_type,std::less<ll>,splay_tree_tag,tree_order_statistics_node_update>sp;//红黑树是rb_tree_tag
/*
inline int read()
{
int x = 0, f = 1; char c = getchar();
while(c < '0' || c > '9') { if(c == '-') f = -f; c = getchar(); }
while(c >= '0' && c <= '9') { x = x * 10 + c - '0'; c = getchar(); }
return x * f;
}
*/
#define maxN 200010
#define M 1000000009
//parameter begin
ll n,k;
ll tmp,nowi,nowj,lasti,lastj,halfi,halfj;
//parameter end
//function begin
//function end
void solve()
{
scanf("%d%d",&n,&k);
tmp=0,nowi=1,nowj=1;
For(i,1,2*n-1)
{
if(i%4==1) nowi=nowj=1+tmp;
else if(i%4==2) nowi=1+tmp,nowj=n-tmp;
else if(i%4==3) nowi=nowj=n-tmp;
else if(i%4==0)
{
nowi=n-tmp;
tmp++;
nowj=1+tmp;
}
printf("%d %d\n",nowi,nowj);
}
lasti=nowi,lastj=1;
printf("%d %d\n",lasti,lastj);
if(k==2*n) return;
tmp=2*n,halfi=n/2;
if(n&1) halfj=n/2+1;
else halfj=n/2;
For(i,1,n)
For(j,1,n)
{
if(i==j) continue;
else if(i==lasti&&j==lastj) continue;
else if( i<=halfi && j>halfj && i==n+1-j ) continue;
else if( i>halfi && j<=halfj && i==n+1-j+1 ) continue;
else
{
tmp++;
printf("%d %d\n",i,j);
if(tmp==k) return;
}
}
return ;
}
int main ()
{
ll T;
T=1;
while(T--) solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3872kb
input:
3 6
output:
1 1 1 3 3 3 3 2 2 2 2 1
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
3 7
output:
1 1 1 3 3 3 3 2 2 2 2 1 1 2
result:
ok The answer is correct.
Test #3:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
2 4
output:
1 1 1 2 2 2 2 1
result:
ok The answer is correct.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
3 9
output:
1 1 1 3 3 3 3 2 2 2 2 1 1 2 2 3 3 1
result:
ok The answer is correct.
Test #5:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
10 20
output:
1 1 1 10 10 10 10 2 2 2 2 9 9 9 9 3 3 3 3 8 8 8 8 4 4 4 4 7 7 7 7 5 5 5 5 6 6 6 6 1
result:
ok The answer is correct.
Test #6:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
10 100
output:
1 1 1 10 10 10 10 2 2 2 2 9 9 9 9 3 3 3 3 8 8 8 8 4 4 4 4 7 7 7 7 5 5 5 5 6 6 6 6 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 1 2 3 2 4 2 5 2 6 2 7 2 8 2 10 3 1 3 2 3 4 3 5 3 6 3 7 3 9 3 10 4 1 4 2 4 3 4 5 4 6 4 8 4 9 4 10 5 1 5 2 5 3 5 4 5 7 5 8 5 9 5 10 6 2 6 3 6 4 6 5 6 7 6 8 6 9 6 10 7 1 7 2 7 3 7 4 7 6...
result:
ok The answer is correct.
Test #7:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
32 64
output:
1 1 1 32 32 32 32 2 2 2 2 31 31 31 31 3 3 3 3 30 30 30 30 4 4 4 4 29 29 29 29 5 5 5 5 28 28 28 28 6 6 6 6 27 27 27 27 7 7 7 7 26 26 26 26 8 8 8 8 25 25 25 25 9 9 9 9 24 24 24 24 10 10 10 10 23 23 23 23 11 11 11 11 22 22 22 22 12 12 12 12 21 21 21 21 13 13 13 13 20 20 20 20 14 14 14 14 19 19 19 19 15...
result:
ok The answer is correct.
Test #8:
score: 0
Accepted
time: 27ms
memory: 3748kb
input:
200000 400000
output:
1 1 1 200000 200000 200000 200000 2 2 2 2 199999 199999 199999 199999 3 3 3 3 199998 199998 199998 199998 4 4 4 4 199997 199997 199997 199997 5 5 5 5 199996 199996 199996 199996 6 6 6 6 199995 199995 199995 199995 7 7 7 7 199994 199994 199994 199994 8 8 8 8 199993 199993 199993 199993 9 9 9 9 199992...
result:
ok The answer is correct.
Test #9:
score: 0
Accepted
time: 55ms
memory: 3868kb
input:
200000 745589
output:
1 1 1 200000 200000 200000 200000 2 2 2 2 199999 199999 199999 199999 3 3 3 3 199998 199998 199998 199998 4 4 4 4 199997 199997 199997 199997 5 5 5 5 199996 199996 199996 199996 6 6 6 6 199995 199995 199995 199995 7 7 7 7 199994 199994 199994 199994 8 8 8 8 199993 199993 199993 199993 9 9 9 9 199992...
result:
ok The answer is correct.
Test #10:
score: 0
Accepted
time: 67ms
memory: 3856kb
input:
199999 978736
output:
1 1 1 199999 199999 199999 199999 2 2 2 2 199998 199998 199998 199998 3 3 3 3 199997 199997 199997 199997 4 4 4 4 199996 199996 199996 199996 5 5 5 5 199995 199995 199995 199995 6 6 6 6 199994 199994 199994 199994 7 7 7 7 199993 199993 199993 199993 8 8 8 8 199992 199992 199992 199992 9 9 9 9 199991...
result:
ok The answer is correct.
Test #11:
score: 0
Accepted
time: 46ms
memory: 3928kb
input:
198054 619549
output:
1 1 1 198054 198054 198054 198054 2 2 2 2 198053 198053 198053 198053 3 3 3 3 198052 198052 198052 198052 4 4 4 4 198051 198051 198051 198051 5 5 5 5 198050 198050 198050 198050 6 6 6 6 198049 198049 198049 198049 7 7 7 7 198048 198048 198048 198048 8 8 8 8 198047 198047 198047 198047 9 9 9 9 198046...
result:
ok The answer is correct.
Test #12:
score: 0
Accepted
time: 38ms
memory: 3852kb
input:
123124 567865
output:
1 1 1 123124 123124 123124 123124 2 2 2 2 123123 123123 123123 123123 3 3 3 3 123122 123122 123122 123122 4 4 4 4 123121 123121 123121 123121 5 5 5 5 123120 123120 123120 123120 6 6 6 6 123119 123119 123119 123119 7 7 7 7 123118 123118 123118 123118 8 8 8 8 123117 123117 123117 123117 9 9 9 9 123116...
result:
ok The answer is correct.
Test #13:
score: 0
Accepted
time: 31ms
memory: 3740kb
input:
124252 416756
output:
1 1 1 124252 124252 124252 124252 2 2 2 2 124251 124251 124251 124251 3 3 3 3 124250 124250 124250 124250 4 4 4 4 124249 124249 124249 124249 5 5 5 5 124248 124248 124248 124248 6 6 6 6 124247 124247 124247 124247 7 7 7 7 124246 124246 124246 124246 8 8 8 8 124245 124245 124245 124245 9 9 9 9 124244...
result:
ok The answer is correct.
Test #14:
score: 0
Accepted
time: 49ms
memory: 3852kb
input:
103503 748077
output:
1 1 1 103503 103503 103503 103503 2 2 2 2 103502 103502 103502 103502 3 3 3 3 103501 103501 103501 103501 4 4 4 4 103500 103500 103500 103500 5 5 5 5 103499 103499 103499 103499 6 6 6 6 103498 103498 103498 103498 7 7 7 7 103497 103497 103497 103497 8 8 8 8 103496 103496 103496 103496 9 9 9 9 103495...
result:
ok The answer is correct.
Test #15:
score: 0
Accepted
time: 66ms
memory: 3852kb
input:
120394 987331
output:
1 1 1 120394 120394 120394 120394 2 2 2 2 120393 120393 120393 120393 3 3 3 3 120392 120392 120392 120392 4 4 4 4 120391 120391 120391 120391 5 5 5 5 120390 120390 120390 120390 6 6 6 6 120389 120389 120389 120389 7 7 7 7 120388 120388 120388 120388 8 8 8 8 120387 120387 120387 120387 9 9 9 9 120386...
result:
ok The answer is correct.
Test #16:
score: 0
Accepted
time: 41ms
memory: 3920kb
input:
123942 619710
output:
1 1 1 123942 123942 123942 123942 2 2 2 2 123941 123941 123941 123941 3 3 3 3 123940 123940 123940 123940 4 4 4 4 123939 123939 123939 123939 5 5 5 5 123938 123938 123938 123938 6 6 6 6 123937 123937 123937 123937 7 7 7 7 123936 123936 123936 123936 8 8 8 8 123935 123935 123935 123935 9 9 9 9 123934...
result:
ok The answer is correct.
Test #17:
score: 0
Accepted
time: 62ms
memory: 3912kb
input:
51251 1000000
output:
1 1 1 51251 51251 51251 51251 2 2 2 2 51250 51250 51250 51250 3 3 3 3 51249 51249 51249 51249 4 4 4 4 51248 51248 51248 51248 5 5 5 5 51247 51247 51247 51247 6 6 6 6 51246 51246 51246 51246 7 7 7 7 51245 51245 51245 51245 8 8 8 8 51244 51244 51244 51244 9 9 9 9 51243 51243 51243 51243 10 10 10 10 51...
result:
ok The answer is correct.
Test #18:
score: 0
Accepted
time: 27ms
memory: 3744kb
input:
200000 400001
output:
1 1 1 200000 200000 200000 200000 2 2 2 2 199999 199999 199999 199999 3 3 3 3 199998 199998 199998 199998 4 4 4 4 199997 199997 199997 199997 5 5 5 5 199996 199996 199996 199996 6 6 6 6 199995 199995 199995 199995 7 7 7 7 199994 199994 199994 199994 8 8 8 8 199993 199993 199993 199993 9 9 9 9 199992...
result:
ok The answer is correct.
Test #19:
score: 0
Accepted
time: 27ms
memory: 3892kb
input:
199999 400001
output:
1 1 1 199999 199999 199999 199999 2 2 2 2 199998 199998 199998 199998 3 3 3 3 199997 199997 199997 199997 4 4 4 4 199996 199996 199996 199996 5 5 5 5 199995 199995 199995 199995 6 6 6 6 199994 199994 199994 199994 7 7 7 7 199993 199993 199993 199993 8 8 8 8 199992 199992 199992 199992 9 9 9 9 199991...
result:
ok The answer is correct.
Test #20:
score: 0
Accepted
time: 15ms
memory: 3744kb
input:
100000 200000
output:
1 1 1 100000 100000 100000 100000 2 2 2 2 99999 99999 99999 99999 3 3 3 3 99998 99998 99998 99998 4 4 4 4 99997 99997 99997 99997 5 5 5 5 99996 99996 99996 99996 6 6 6 6 99995 99995 99995 99995 7 7 7 7 99994 99994 99994 99994 8 8 8 8 99993 99993 99993 99993 9 9 9 9 99992 99992 99992 99992 10 10 10 1...
result:
ok The answer is correct.
Test #21:
score: 0
Accepted
time: 2ms
memory: 3792kb
input:
14125 28290
output:
1 1 1 14125 14125 14125 14125 2 2 2 2 14124 14124 14124 14124 3 3 3 3 14123 14123 14123 14123 4 4 4 4 14122 14122 14122 14122 5 5 5 5 14121 14121 14121 14121 6 6 6 6 14120 14120 14120 14120 7 7 7 7 14119 14119 14119 14119 8 8 8 8 14118 14118 14118 14118 9 9 9 9 14117 14117 14117 14117 10 10 10 10 14...
result:
ok The answer is correct.
Test #22:
score: 0
Accepted
time: 64ms
memory: 3924kb
input:
200000 1000000
output:
1 1 1 200000 200000 200000 200000 2 2 2 2 199999 199999 199999 199999 3 3 3 3 199998 199998 199998 199998 4 4 4 4 199997 199997 199997 199997 5 5 5 5 199996 199996 199996 199996 6 6 6 6 199995 199995 199995 199995 7 7 7 7 199994 199994 199994 199994 8 8 8 8 199993 199993 199993 199993 9 9 9 9 199992...
result:
ok The answer is correct.
Test #23:
score: 0
Accepted
time: 62ms
memory: 3848kb
input:
100000 1000000
output:
1 1 1 100000 100000 100000 100000 2 2 2 2 99999 99999 99999 99999 3 3 3 3 99998 99998 99998 99998 4 4 4 4 99997 99997 99997 99997 5 5 5 5 99996 99996 99996 99996 6 6 6 6 99995 99995 99995 99995 7 7 7 7 99994 99994 99994 99994 8 8 8 8 99993 99993 99993 99993 9 9 9 9 99992 99992 99992 99992 10 10 10 1...
result:
ok The answer is correct.
Test #24:
score: 0
Accepted
time: 61ms
memory: 3912kb
input:
1000 1000000
output:
1 1 1 1000 1000 1000 1000 2 2 2 2 999 999 999 999 3 3 3 3 998 998 998 998 4 4 4 4 997 997 997 997 5 5 5 5 996 996 996 996 6 6 6 6 995 995 995 995 7 7 7 7 994 994 994 994 8 8 8 8 993 993 993 993 9 9 9 9 992 992 992 992 10 10 10 10 991 991 991 991 11 11 11 11 990 990 990 990 12 12 12 12 989 989 989 98...
result:
ok The answer is correct.
Test #25:
score: 0
Accepted
time: 20ms
memory: 3788kb
input:
532 283024
output:
1 1 1 532 532 532 532 2 2 2 2 531 531 531 531 3 3 3 3 530 530 530 530 4 4 4 4 529 529 529 529 5 5 5 5 528 528 528 528 6 6 6 6 527 527 527 527 7 7 7 7 526 526 526 526 8 8 8 8 525 525 525 525 9 9 9 9 524 524 524 524 10 10 10 10 523 523 523 523 11 11 11 11 522 522 522 522 12 12 12 12 521 521 521 521 13...
result:
ok The answer is correct.
Test #26:
score: 0
Accepted
time: 37ms
memory: 3880kb
input:
121434 568983
output:
1 1 1 121434 121434 121434 121434 2 2 2 2 121433 121433 121433 121433 3 3 3 3 121432 121432 121432 121432 4 4 4 4 121431 121431 121431 121431 5 5 5 5 121430 121430 121430 121430 6 6 6 6 121429 121429 121429 121429 7 7 7 7 121428 121428 121428 121428 8 8 8 8 121427 121427 121427 121427 9 9 9 9 121426...
result:
ok The answer is correct.
Test #27:
score: 0
Accepted
time: 3ms
memory: 3788kb
input:
11111 32222
output:
1 1 1 11111 11111 11111 11111 2 2 2 2 11110 11110 11110 11110 3 3 3 3 11109 11109 11109 11109 4 4 4 4 11108 11108 11108 11108 5 5 5 5 11107 11107 11107 11107 6 6 6 6 11106 11106 11106 11106 7 7 7 7 11105 11105 11105 11105 8 8 8 8 11104 11104 11104 11104 9 9 9 9 11103 11103 11103 11103 10 10 10 10 11...
result:
ok The answer is correct.
Test #28:
score: 0
Accepted
time: 41ms
memory: 3856kb
input:
200000 600000
output:
1 1 1 200000 200000 200000 200000 2 2 2 2 199999 199999 199999 199999 3 3 3 3 199998 199998 199998 199998 4 4 4 4 199997 199997 199997 199997 5 5 5 5 199996 199996 199996 199996 6 6 6 6 199995 199995 199995 199995 7 7 7 7 199994 199994 199994 199994 8 8 8 8 199993 199993 199993 199993 9 9 9 9 199992...
result:
ok The answer is correct.
Test #29:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
64 128
output:
1 1 1 64 64 64 64 2 2 2 2 63 63 63 63 3 3 3 3 62 62 62 62 4 4 4 4 61 61 61 61 5 5 5 5 60 60 60 60 6 6 6 6 59 59 59 59 7 7 7 7 58 58 58 58 8 8 8 8 57 57 57 57 9 9 9 9 56 56 56 56 10 10 10 10 55 55 55 55 11 11 11 11 54 54 54 54 12 12 12 12 53 53 53 53 13 13 13 13 52 52 52 52 14 14 14 14 51 51 51 51 15...
result:
ok The answer is correct.
Test #30:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
128 8920
output:
1 1 1 128 128 128 128 2 2 2 2 127 127 127 127 3 3 3 3 126 126 126 126 4 4 4 4 125 125 125 125 5 5 5 5 124 124 124 124 6 6 6 6 123 123 123 123 7 7 7 7 122 122 122 122 8 8 8 8 121 121 121 121 9 9 9 9 120 120 120 120 10 10 10 10 119 119 119 119 11 11 11 11 118 118 118 118 12 12 12 12 117 117 117 117 13...
result:
ok The answer is correct.
Extra Test:
score: 0
Extra Test Passed