QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#247020#7619. Make SYSU Great Again Iucup-team037#AC ✓188ms22452kbC++171.7kb2023-11-11 13:14:332023-11-11 13:14:35

Judging History

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

  • [2023-11-11 13:14:35]
  • 评测
  • 测评结果:AC
  • 用时:188ms
  • 内存:22452kb
  • [2023-11-11 13:14:33]
  • 提交

answer


// Hallelujah, praise the one who set me free
// Hallelujah, death has lost its grip on me
// You have broken every chain, There's salvation in your name
// Jesus Christ, my living hope
#include <bits/stdc++.h> 
using namespace std;

#define REP(i, s, e) for (int i = (s); i < (e); i++)
#define RREP(i, s, e) for (int i = (s); i >= (e); i--)
template <class T>
inline bool mnto(T& a, T b) {return a > b ? a = b, 1 : 0;}
template <class T>
inline bool mxto(T& a, T b) {return a < b ? a = b, 1: 0;}

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define FI first
#define SE second
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef tuple<int, int, int> iii;
#define ALL(_a) _a.begin(), _a.end()
#define SZ(_a) (int) _a.size()
#define pb push_back
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef vector<iii> viii;

#ifndef DEBUG
#define cerr if (0) cerr
#endif

const int INF = 1000000005;
const ll LINF = 1000000000000000005ll;
const int MAXN = 200005;

int n, k;
set<ii> used;

int main() {
#ifndef DEBUG
    ios::sync_with_stdio(0), cin.tie(0);
#endif
    cin >> n >> k;
    int ur = 1, uc = 1;
    REP (i, 1, 2 * n + 1) {
        cout << ur << ' ' << uc << '\n';
        used.insert({ur, uc});
        k--;
        if (i & 1) {
            ur++;
            if (ur > n) {
                ur -= n;
            }
        } else {
            uc++;
        }
    }
    REP (i, 1, n + 1) {
        REP (j, 1, n + 1) {
            if (k == 0) {
                break;
            }
            if (used.find({i, j}) != used.end()) {
                continue;
            }
            cout << i << ' ' << j << '\n';
            k--;
        }
        if (k == 0) {
            break;
        }
    }
}

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

详细

Test #1:

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

input:

3 6

output:

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

result:

ok The answer is correct.

Test #2:

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

input:

3 7

output:

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

result:

ok The answer is correct.

Test #3:

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

input:

2 4

output:

1 1
2 1
2 2
1 2

result:

ok The answer is correct.

Test #4:

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

input:

3 9

output:

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

result:

ok The answer is correct.

Test #5:

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

input:

10 20

output:

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

result:

ok The answer is correct.

Test #6:

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

input:

10 100

output:

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

result:

ok The answer is correct.

Test #7:

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

input:

32 64

output:

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

result:

ok The answer is correct.

Test #8:

score: 0
Accepted
time: 115ms
memory: 22364kb

input:

200000 400000

output:

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

result:

ok The answer is correct.

Test #9:

score: 0
Accepted
time: 159ms
memory: 22372kb

input:

200000 745589

output:

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

result:

ok The answer is correct.

Test #10:

score: 0
Accepted
time: 188ms
memory: 22296kb

input:

199999 978736

output:

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

result:

ok The answer is correct.

Test #11:

score: 0
Accepted
time: 126ms
memory: 22204kb

input:

198054 619549

output:

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

result:

ok The answer is correct.

Test #12:

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

input:

123124 567865

output:

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

result:

ok The answer is correct.

Test #13:

score: 0
Accepted
time: 79ms
memory: 15272kb

input:

124252 416756

output:

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

result:

ok The answer is correct.

Test #14:

score: 0
Accepted
time: 112ms
memory: 13380kb

input:

103503 748077

output:

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

result:

ok The answer is correct.

Test #15:

score: 0
Accepted
time: 138ms
memory: 14908kb

input:

120394 987331

output:

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

result:

ok The answer is correct.

Test #16:

score: 0
Accepted
time: 108ms
memory: 15244kb

input:

123942 619710

output:

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

result:

ok The answer is correct.

Test #17:

score: 0
Accepted
time: 119ms
memory: 8384kb

input:

51251 1000000

output:

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

result:

ok The answer is correct.

Test #18:

score: 0
Accepted
time: 113ms
memory: 22300kb

input:

200000 400001

output:

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

result:

ok The answer is correct.

Test #19:

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

input:

199999 400001

output:

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

result:

ok The answer is correct.

Test #20:

score: 0
Accepted
time: 57ms
memory: 13052kb

input:

100000 200000

output:

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

result:

ok The answer is correct.

Test #21:

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

input:

14125 28290

output:

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

result:

ok The answer is correct.

Test #22:

score: 0
Accepted
time: 176ms
memory: 22300kb

input:

200000 1000000

output:

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

result:

ok The answer is correct.

Test #23:

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

input:

100000 1000000

output:

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

result:

ok The answer is correct.

Test #24:

score: 0
Accepted
time: 80ms
memory: 3672kb

input:

1000 1000000

output:

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

result:

ok The answer is correct.

Test #25:

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

input:

532 283024

output:

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

result:

ok The answer is correct.

Test #26:

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

input:

121434 568983

output:

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

result:

ok The answer is correct.

Test #27:

score: 0
Accepted
time: 6ms
memory: 4684kb

input:

11111 32222

output:

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

result:

ok The answer is correct.

Test #28:

score: 0
Accepted
time: 131ms
memory: 22452kb

input:

200000 600000

output:

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

result:

ok The answer is correct.

Test #29:

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

input:

64 128

output:

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

result:

ok The answer is correct.

Test #30:

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

input:

128 8920

output:

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

result:

ok The answer is correct.

Extra Test:

score: 0
Extra Test Passed