编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#100339 #1152. 连连看 Wrong Answer 0 2214 ms 2920 K C++ 17 / 2.2 K wahahah 2023-07-12 23:03:14
显示原始代码
//#pragma GCC optimize("Ofast","unroll-loops","O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
//#include <atcoder/all>
// using namespace atcoder;
// using mint = modint998244353;
using namespace std;
using cd = complex<double>;
#define fi first
#define PI acos(-1)
#define se second
#define eps 1e-10
#define IOS                  \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0)
#define HP(x) cout << fixed << setprecision(x);
#define popcnt(x) __builtin_popcountll(x)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define sumv(a) accumulate(all(a), 0LL)
#define lb(v, a) (lower_bound(begin(v), end(v), a) - begin(v))
#define ub(v, a) (upper_bound(begin(v), end(v), a) - begin(v))
#define inq(x, l, r) (l <= x && x <= r)
typedef long long ll;
typedef __int128 big;
typedef unsigned int ull;
typedef string str;
typedef long double db;
typedef pair<ll, ll> pll;
typedef pair<db, db> pdd;
typedef pair<int, int> pii;
typedef pair<pll, ll> pp;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<db> vd;
typedef vector<str> vs;
typedef vector<vector<ll>> mal;
typedef vector<vector<int>> mai;
typedef vector<vector<str>> mas;
typedef vector<vector<db>> mad;
mt19937_64 rnd(chrono::system_clock::now().time_since_epoch().count());  // rnd()%n,shuffle(a+1,a+1+n,rnd);
const ll N = 2e5 + 5, M = 1024, H1 = 1000159, H2 = 1000133, G = 1e9, mod = 998244353;
ll n;
struct ppp {
    ll x, y, w;
} a[N];
bool cmpx(ppp i, ppp j) { return i.x < j.x; }
bool cmpy(ppp i, ppp j) { return i.y < j.y; }
int main() {
    IOS;
    cin >> n;
    for (ll i = 1; i <= n; i++) {
        cin >> a[i].x >> a[i].y;
        a[i].w = i;
    }
    if (n % 2 == 1) {
        sort(a + 1, a + 1 + n, cmpx);
        ll x = a[(n + 1) / 2].x;
        sort(a + 1, a + 1 + n, cmpy);
        ll y = a[(n + 1) / 2].y, pos = -1, mi = 2e18;
        for (ll i = 1; i <= n; i++) {
            if (abs(a[i].x - x) + abs(a[i].y - y) < mi) {
                mi = abs(a[i].x - x) + abs(a[i].y - y);
                pos = i;
            }
        }
        swap(a[n], a[pos]);
        n--;
    }
    sort(a + 1, a + 1 + n, cmpx);
    sort(a + 1, a + 1 + n / 2, cmpy);
    sort(a + 1 + n / 2, a + 1 + n, cmpy);
    cout << n / 2 << endl;
    for (ll i = 1; i <= n / 2; i++) {
        cout << a[i].w << " " << a[n - i + 1].w << endl;
    }
}
子任务 #1
Wrong Answer
得分:0
测试点 #1
Wrong Answer
得分:0
用时:107 ms
内存:2776 KiB

输入文件(input1.in

99994
39904 35083
46820 36679
18613 3814
6474 19631
37764 36525
18319 33414
45300 26489
21133 11529

<1155515 bytes omitted>

答案文件(input1.out

1665399942

用户输出

49997
83914 87169
39831 91146
14533 7162
69418 85208
89043 87399
85584 59626
454 96476
73442 72841
99544 14591
49087 95648
79284
<588736 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #2
Wrong Answer
得分:0
用时:102 ms
内存:2656 KiB

输入文件(input2.in

99966
29572 24605
33552 8402
18093 9640
547 31444
251 3309
43619 22874
32618 14747
3018 19766
37882 
<1155228 bytes omitted>

答案文件(input2.out

1664919648

用户输出

49983
49848 91698
45987 25859
30983 51684
75323 34189
82498 95097
36474 85401
44172 78714
60942 71317
98430 84707
54954 11043
49
<588568 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #3
Wrong Answer
得分:0
用时:128 ms
内存:2672 KiB

输入文件(input3.in

99959
24963 15592
20533 22230
22960 10397
32438 32270
16368 45627
25843 147
28835 6570
37998 16798
1
<1155287 bytes omitted>

答案文件(input3.out

1661963157

用户输出

49979
72643 22988
15093 56527
34698 36386
38361 1160
83622 41737
19033 5863
23392 59647
10504 94724
65762 35918
25972 11256
4672
<588520 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #4
Wrong Answer
得分:0
用时:97 ms
内存:2708 KiB

输入文件(input4.in

99950
2417 45567
19300 44813
23263 44027
33863 2702
39461 4555
42612 32590
15374 27421
31106 10493
4
<1155004 bytes omitted>

答案文件(input4.out

1662916373

用户输出

49975
93641 30891
30961 17022
18421 25298
99236 57493
16408 75718
33395 2712
46363 1204
65063 75307
92184 1819
91096 31698
79140
<588472 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #5
Wrong Answer
得分:0
用时:89 ms
内存:2660 KiB

输入文件(input5.in

99972
45280 44508
29577 24171
8151 8714
7100 44734
49861 28412
31199 14196
17156 34102
32122 48695
4
<1155310 bytes omitted>

答案文件(input5.out

1664148272

用户输出

49986
65608 88052
19608 57884
71554 79352
70245 56634
7859 46309
92325 46754
53544 37451
82893 67565
22488 13469
39900 34508
742
<588604 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #6
Wrong Answer
得分:0
用时:100 ms
内存:2748 KiB

输入文件(input7.in

99994
22203 12731
48860 13276
9330 45678
45445 29249
15122 11965
11386 19038
21223 30977
15157 31632
<1155538 bytes omitted>

答案文件(input7.out

1665321412

用户输出

49997
73192 14364
9632 10312
35602 25398
63125 30739
19415 56885
91428 90585
20070 97125
13112 54616
44111 18526
47104 22898
511
<588736 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #7
Wrong Answer
得分:0
用时:88 ms
内存:2920 KiB

输入文件(input8.in

99994
8 4
10 6
4 4
6 9
7 5
9 5
10 8
8 3
2 7
2 10
10 2
2 10
9 9
6 7
5 4
8 4
3 10
10 8
7 5
8 5
10 8
8 
<419780 bytes omitted>

答案文件(input8.out

330146

用户输出

49997
1332 23040
43842 35518
320 22698
54819 69277
56970 25881
58517 88434
86691 51125
81905 92719
93600 65099
88015 99000
9633 
<588736 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #8
Wrong Answer
得分:0
用时:106 ms
内存:2764 KiB

输入文件(input9.in

99969
4 8
8 6
2 6
9 10
4 10
10 4
1 5
9 9
3 9
9 2
7 3
1 10
10 9
9 3
8 4
9 6
10 5
3 7
9 4
6 6
3 10
10 
<419576 bytes omitted>

答案文件(input9.out

329492

用户输出

49984
2741 86209
10050 69016
36154 76050
38020 68566
62770 8990
87105 69289
24217 87780
24221 11448
7975 49084
4220 8811
40164 6
<588580 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #9
Wrong Answer
得分:0
用时:95 ms
内存:2692 KiB

输入文件(input10.in

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

<419631 bytes omitted>

答案文件(input10.out

329440

用户输出

49993
42956 6889
59113 73304
37904 38542
63332 33472
59217 36846
87251 38314
63201 74014
40123 4371
86025 73215
91074 86645
4619
<588688 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #10
Wrong Answer
得分:0
用时:99 ms
内存:2664 KiB

输入文件(input11.in

99987
8 8
6 10
9 8
6 7
7 4
3 8
1 7
5 8
5 7
8 8
9 3
1 5
3 10
10 8
1 5
3 7
10 4
9 2
4 1
7 6
2 1
1 10
4
<419934 bytes omitted>

答案文件(input11.out

330047

用户输出

49993
20800 36337
87992 57534
77435 57524
6993 56829
83766 22547
42697 1359
9276 99442
77710 15890
83338 90563
84160 44755
14259
<588688 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #11
Wrong Answer
得分:0
用时:101 ms
内存:2744 KiB

输入文件(input12.in

99991
1 9
6 6
8 9
8 9
10 10
3 7
8 10
4 5
3 6
6 10
3 8
7 7
1 6
7 1
9 2
3 1
6 7
7 10
5 4
7 3
8 9
3 3
1
<419968 bytes omitted>

答案文件(input12.out

330232

用户输出

49995
38038 14628
68655 71615
7138 61205
9783 87739
334 87824
77485 49101
59768 15773
58184 72226
82995 94246
10345 25950
99738 
<588712 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #12
Wrong Answer
得分:0
用时:101 ms
内存:2696 KiB

输入文件(input13.in

99981
2 5
7 10
9 9
9 8
3 10
10 1
5 4
9 10
7 7
9 2
3 3
5 8
10 9
6 10
3 4
1 6
2 1
8 7
9 1
2 9
1 1
3 10
<419894 bytes omitted>

答案文件(input13.out

329860

用户输出

49990
20292 32191
19977 2041
43479 63273
47665 13426
47801 82340
47790 22014
75931 75597
75945 20228
48174 47250
19271 56644
755
<588652 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #13
Wrong Answer
得分:0
用时:86 ms
内存:2668 KiB

输入文件(input14.in

99970
2 6
8 5
4 5
4 7
6 9
1 8
2 7
6 6
3 8
1 3
5 5
10 8
10 2
3 9
4 4
2 6
1 9
9 8
7 8
1 7
5 6
6 5
10 3
<419547 bytes omitted>

答案文件(input14.out

329442

用户输出

49985
54563 53627
7328 99353
74587 22810
47253 54909
31549 87078
31554 96494
97359 44507
32472 81848
68507 28443
73505 70244
744
<588592 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #14
Wrong Answer
得分:0
用时:151 ms
内存:2672 KiB

输入文件(input15.in

99951
43016666 705054189
23890816 191954409
48367680 178083192
65698935 509772667
809449080 63876393
<1972731 bytes omitted>

答案文件(input15.out

33839316800310

用户输出

49975
59045 31798
31686 31900
11426 42346
57489 4125
54777 54829
99216 38890
28452 27114
54355 22758
43955 21355
27091 51713
723
<588473 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #15
Wrong Answer
得分:0
用时:103 ms
内存:2800 KiB

输入文件(input16.in

99950
390196982 16217026
756299460 557589375
845307426 215064985
403301484 72900781
989173256 503715
<1973044 bytes omitted>

答案文件(input16.out

33893190316304

用户输出

49975
3834 56578
8311 4972
11913 9434
39611 61650
16773 66681
95657 50251
66680 64937
96288 66715
74343 57079
80053 58453
89049 
<588472 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #16
Wrong Answer
得分:0
用时:108 ms
内存:2776 KiB

输入文件(input17.in

99966
309713742 103345138
912956589 605640153
759597371 959523157
958180894 12282372
124979541 33724
<1973228 bytes omitted>

答案文件(input17.out

33869086670134

用户输出

49983
7008 38747
34709 56505
86713 89966
87203 48722
11389 82068
76587 58085
42362 52368
18694 7104
24758 89603
8631 11624
69500
<588568 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #17
Wrong Answer
得分:0
用时:126 ms
内存:2672 KiB

输入文件(input18.in

99989
662308788 188157881
945161135 936031796
224331765 646572957
176241418 73020933
141324820 14925
<1973587 bytes omitted>

答案文件(input18.out

33895043667584

用户输出

49994
20647 65835
81885 58121
20577 94320
49089 52800
67696 29581
95918 8553
80215 53396
45412 22509
75088 48705
22883 88724
589
<588700 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #18
Wrong Answer
得分:0
用时:129 ms
内存:2804 KiB

输入文件(input19.in

99973
154453232 656240272
715155228 848233937
852480696 275617197
561544202 123073069
472873249 7570
<1973611 bytes omitted>

答案文件(input19.out

33855972714822

用户输出

49986
86456 88831
63147 60570
49130 26641
14005 3360
59437 56138
90875 63151
78141 41619
63065 82035
29362 5518
69582 86703
2761
<588605 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #19
Wrong Answer
得分:0
用时:144 ms
内存:2692 KiB

输入文件(input20.in

99963
330145838 658516321
110794903 347274671
457221490 32851628
825966653 737106317
215914215 91143
<1973595 bytes omitted>

答案文件(input20.out

33750931421773

用户输出

49981
85396 61167
33686 8357
78525 18284
49136 77917
75145 83529
75676 98414
99610 77202
35311 67000
80075 13379
14891 26541
239
<588544 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0
测试点 #20
Wrong Answer
得分:0
用时:154 ms
内存:2748 KiB

输入文件(input21.in

99955
645861926 798882887
204604371 64809073
832321434 183260368
540647278 28314156
852540009 437805
<1973031 bytes omitted>

答案文件(input21.out

33814666330789

用户输出

49977
45715 75993
74279 60694
91735 49459
54998 44354
55658 39089
4254 54553
36060 19556
82302 53550
66929 28902
78929 52969
983
<588496 bytes omitted>

Special Judge 信息

Something is wrong...

系统信息

Exited with return code 0