QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#90751#5255. Greedy DrawersValera_GrinenkoAC ✓3ms3476kbC++142.9kb2023-03-25 04:25:192023-03-25 04:25:23

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-25 04:25:23]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3476kb
  • [2023-03-25 04:25:19]
  • 提交

answer


//#pragma GCC optimize("Ofast", "unroll-loops")
//#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4")

#ifdef __APPLE__

#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <cstdint>
#include <cstring>
#include <string>
#include <cstdlib>
#include <vector>
#include <bitset>
#include <map>
#include <queue>
#include <ctime>
#include <stack>
#include <set>
#include <list>
#include <random>
#include <deque>
#include <functional>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <complex>
#include <numeric>
#include <immintrin.h>
#include <cassert>
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <thread>

#else
#include <bits/stdc++.h>
#endif

#define all(a) a.begin(),a.end()
#define len(a) (int)(a.size())
#define mp make_pair
#define pb push_back
#define fir first
#define sec second
#define fi first
#define se second

using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;

template<typename T>
bool umin(T &a, T b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

template<typename T>
bool umax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

#if __APPLE__
#define D for (bool _FLAG = true; _FLAG; _FLAG = false)
#define LOG(...) print(#__VA_ARGS__" ::", __VA_ARGS__) << endl

template<class ...Ts>
auto &print(Ts ...ts) { return ((cerr << ts << " "), ...); }

#else
#define D while (false)
#define LOG(...)
#endif

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int x[6] = {2, 3, 4, 5, 6, 6};
int y[6] = {0, 0, 2, 3, 4, 4};

void solve() {
    int n; cin >> n;
    vector<pair<int, int> > a, b;
    for(int i = 1; i <= n; i++) a.pb({i, 700 - i + 1});
    int kek = 0;
    while(kek + 6 <= n) {
        for(int i = 0; i < 6; i++) b.pb({kek + x[i], 700 - (kek + y[i])});
        kek += 6;
    }
    for(int i = kek + 1; i <= n; i++) b.pb({n, 700 - kek});
    for(auto& X : a) cout << X.fi << ' ' << X.se << '\n';
    cout << '\n';
    for(auto& X : b) cout << X.fi << ' ' << X.se << '\n';
    cout << '\n';
//    for(int i = 1; i <= n; i++) cout << i << ' ' << 696 - i << '\n';
//    cout << '\n';
//    int kek = 0;
//    while(kek + 8 <= n) {
//        for(int i = 0; i < 8; i++) {
//            cout << 696 - (kek + x[i]) << ' ' << kek + y[i] << '\n';
//        }
//        kek += 8;
//    }
//    for (int i = kek + 1; i <= n; i++) {
//        cout << n << ' ' << 696 - (kek + 1) << '\n';
//    }
}

signed main() {
//   freopen("input.txt", "r", stdin);
//   freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t = 1;

    //cin >> t;

    while (t--) solve();

}

/*
KIVI
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3464kb

input:

150

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #2:

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

input:

151

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #3:

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

input:

152

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #4:

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

input:

153

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #5:

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

input:

154

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #6:

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

input:

155

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #7:

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

input:

156

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #8:

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

input:

157

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #9:

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

input:

158

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #10:

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

input:

159

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #11:

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

input:

160

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #12:

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

input:

161

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #13:

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

input:

162

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #14:

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

input:

163

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #15:

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

input:

164

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #16:

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

input:

165

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #17:

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

input:

166

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #18:

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

input:

167

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #19:

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

input:

168

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy

Test #20:

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

input:

250

output:

1 700
2 699
3 698
4 697
5 696
6 695
7 694
8 693
9 692
10 691
11 690
12 689
13 688
14 687
15 686
16 685
17 684
18 683
19 682
20 681
21 680
22 679
23 678
24 677
25 676
26 675
27 674
28 673
29 672
30 671
31 670
32 669
33 668
34 667
35 666
36 665
37 664
38 663
39 662
40 661
41 660
42 659
43 658
44 657
4...

result:

ok you killed Janko's strategy