QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#248071#7619. Make SYSU Great Again Iucup-team2235#AC ✓301ms89524kbC++17871b2023-11-11 17:21:452023-11-11 17:21:45

Judging History

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

  • [2023-11-11 17:21:45]
  • 评测
  • 测评结果:AC
  • 用时:301ms
  • 内存:89524kb
  • [2023-11-11 17:21:45]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> pii;
main(){
  ios::sync_with_stdio(false);
  int n,k,l=1; cin>>n>>k;
  vector<int> a;
  for(int i=1;i<=k;i++)
    a.emplace_back(i);
  vector<pii> p(k+1);
  bool f=false;
  map<pii,bool> m;
  int x=1,y=0;
  while(x<=n&&y<=n){
    m[p[l++]=make_pair(x,y)]=true;
    if(f)x+=2;
    else y+=2;
    f^=1;
  }
  x=n+1,y=n,f=n&1;
  if(~n&1)swap(x,y);
  while(x>=1&&y>=1){
    m[p[l++]=make_pair(x,y)]=true;
    if(f)x-=2;
    else y-=2;
    f^=1;
  }
  p[1].second++;
  if(n&1)p[n+1].first--;
  else p[n+1].second--;
  m[p[1]]=m[p[n+1]]=true;
  for(int i=1;i<=n&&l<=k;i++)
    for(int j=1;j<=n&&l<=k;j++)
      if(!m[make_pair(i,j)])
        p[l++]=make_pair(i,j);
  for(int i=1;i<=k;i++)
    cout<<p[i].first<<' '<<p[i].second<<'\n';
  return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 6

output:

1 1
1 2
3 2
3 3
2 3
2 1

result:

ok The answer is correct.

Test #2:

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

input:

3 7

output:

1 1
1 2
3 2
3 3
2 3
2 1
1 3

result:

ok The answer is correct.

Test #3:

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

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

input:

3 9

output:

1 1
1 2
3 2
3 3
2 3
2 1
1 3
2 2
3 1

result:

ok The answer is correct.

Test #5:

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

input:

10 20

output:

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

result:

ok The answer is correct.

Test #6:

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

input:

10 100

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
10 10
10 9
8 9
8 7
6 7
6 5
4 5
4 3
2 3
2 1
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
2 2
2 4
2 5
2 6
2 7
2 8
2 9
2 10
3 1
3 3
3 5
3 6
3 7
3 8
3 9
3 10
4 1
4 2
4 4
4 6
4 7
4 8
4 9
4 10
5 1
5 2
5 3
5 5
5 7
5 8
5 9
5 10
6 1
6 2
6 3
6 4
6 6
6 8
6 9
6 10
7 1
7 2
7 3
7 4
7 ...

result:

ok The answer is correct.

Test #7:

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

input:

32 64

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
32 32
32 31
30 31
30 29
28 29
28 27
26 27
26 25
24 25
24 23
22 23
22 21
20 21
20 19
18 19
18 17
16 17
16 15
14 15
14 13
12 13
1...

result:

ok The answer is correct.

Test #8:

score: 0
Accepted
time: 102ms
memory: 37452kb

input:

200000 400000

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #9:

score: 0
Accepted
time: 198ms
memory: 69316kb

input:

200000 745589

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #10:

score: 0
Accepted
time: 261ms
memory: 87684kb

input:

199999 978736

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #11:

score: 0
Accepted
time: 162ms
memory: 57804kb

input:

198054 619549

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #12:

score: 0
Accepted
time: 151ms
memory: 52236kb

input:

123124 567865

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #13:

score: 0
Accepted
time: 104ms
memory: 39864kb

input:

124252 416756

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #14:

score: 0
Accepted
time: 219ms
memory: 68692kb

input:

103503 748077

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #15:

score: 0
Accepted
time: 268ms
memory: 88116kb

input:

120394 987331

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #16:

score: 0
Accepted
time: 141ms
memory: 58124kb

input:

123942 619710

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #17:

score: 0
Accepted
time: 282ms
memory: 89184kb

input:

51251 1000000

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #18:

score: 0
Accepted
time: 105ms
memory: 38256kb

input:

200000 400001

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #19:

score: 0
Accepted
time: 103ms
memory: 37956kb

input:

199999 400001

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #20:

score: 0
Accepted
time: 40ms
memory: 20344kb

input:

100000 200000

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #21:

score: 0
Accepted
time: 3ms
memory: 5800kb

input:

14125 28290

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #22:

score: 0
Accepted
time: 301ms
memory: 89524kb

input:

200000 1000000

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #23:

score: 0
Accepted
time: 286ms
memory: 89048kb

input:

100000 1000000

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #24:

score: 0
Accepted
time: 225ms
memory: 89104kb

input:

1000 1000000

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #25:

score: 0
Accepted
time: 61ms
memory: 27740kb

input:

532 283024

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #26:

score: 0
Accepted
time: 152ms
memory: 52268kb

input:

121434 568983

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #27:

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

input:

11111 32222

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #28:

score: 0
Accepted
time: 172ms
memory: 54848kb

input:

200000 600000

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #29:

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

input:

64 128

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Test #30:

score: 0
Accepted
time: 2ms
memory: 3924kb

input:

128 8920

output:

1 1
1 2
3 2
3 4
5 4
5 6
7 6
7 8
9 8
9 10
11 10
11 12
13 12
13 14
15 14
15 16
17 16
17 18
19 18
19 20
21 20
21 22
23 22
23 24
25 24
25 26
27 26
27 28
29 28
29 30
31 30
31 32
33 32
33 34
35 34
35 36
37 36
37 38
39 38
39 40
41 40
41 42
43 42
43 44
45 44
45 46
47 46
47 48
49 48
49 50
51 50
51 52
53 52
5...

result:

ok The answer is correct.

Extra Test:

score: 0
Extra Test Passed