172072025-06-03 15:31:30ercseferencSzimmetrikus sorozatcpp17Wrong answer 0/100108ms11488 KiB
#include <bits/stdc++.h>
using namespace std;
struct par{int a,b;};
struct adatszam{int ert,ind,csop;};
bool has1(adatszam m, adatszam n){
    return m.ert<n.ert;}
bool has2(adatszam m, adatszam n){
    return m.ind<n.ind;}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0); vector<par>b;
    int n,x,y; cin>>n;
    vector<adatszam>a(n);
    for(int i=0; i<n; i++){cin>>a[i].ert; a[i].ind=i;}
    vector<vector<int> >csoportok; int t=0;
    sort(a.begin(),a.end(), has1);
    vector<int>ures; csoportok.push_back(ures);
   for(int i=0; i<n; i++){
        csoportok[t].push_back(a[i].ind);
        a[i].csop=t;
        if(a[i].ert!=a[i+1].ert && i!=n-1){t++;
        csoportok.push_back(ures);}}
    sort(a.begin(),a.end(), has2);
    for(int i=0; i<n/2; i++){
        if(a[i].ert!=a[n-i-1].ert){
            if(a[i].ert>a[n-i-1].ert){
                x=n-i-1, y=i;}
            else {x=i; y=n-i-1;}
            par q; q.a=a[y].ert; q.b=a[x].ert; b.push_back(q);
            int v=csoportok[a[y].csop].size();
            int w=a[y].csop;
            /*for(int j=0; j<v; j++){
                csoportok[a[x].csop].push_back(csoportok[w][j]);
                a[csoportok[w][j]].ert=a[x].ert;
                a[csoportok[w][j]].csop=a[x].csop;}*/}}
    /*cout<<b.size()<<endl;
    for(int i=0; i<b.size(); i++)cout<<b[i].a<<" "<<b[i].b<<endl;*/
    cout<<0;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms316 KiB
2Wrong answer48ms5096 KiB
subtask20/9
3Wrong answer2ms316 KiB
4Wrong answer2ms692 KiB
5Wrong answer2ms500 KiB
6Accepted2ms316 KiB
7Wrong answer1ms316 KiB
subtask30/14
8Wrong answer1ms500 KiB
9Wrong answer1ms316 KiB
10Wrong answer1ms316 KiB
11Wrong answer1ms316 KiB
12Wrong answer1ms316 KiB
13Wrong answer1ms316 KiB
subtask40/25
14Wrong answer1ms508 KiB
15Wrong answer1ms508 KiB
16Wrong answer2ms568 KiB
17Wrong answer2ms756 KiB
18Wrong answer2ms564 KiB
19Wrong answer2ms508 KiB
20Wrong answer2ms316 KiB
21Wrong answer2ms316 KiB
subtask50/22
22Wrong answer96ms9868 KiB
23Wrong answer97ms9860 KiB
24Wrong answer103ms9952 KiB
25Wrong answer101ms9864 KiB
26Wrong answer98ms9952 KiB
27Wrong answer97ms9952 KiB
28Wrong answer100ms9904 KiB
29Wrong answer101ms9952 KiB
30Wrong answer96ms9948 KiB
31Wrong answer96ms9952 KiB
32Wrong answer94ms10068 KiB
33Wrong answer104ms9864 KiB
34Wrong answer90ms9952 KiB
35Wrong answer94ms9864 KiB
36Wrong answer90ms9868 KiB
37Wrong answer97ms9864 KiB
subtask60/30
38Wrong answer1ms508 KiB
39Wrong answer48ms5096 KiB
40Wrong answer2ms316 KiB
41Wrong answer2ms692 KiB
42Wrong answer2ms500 KiB
43Accepted2ms316 KiB
44Wrong answer1ms316 KiB
45Wrong answer1ms500 KiB
46Wrong answer1ms316 KiB
47Wrong answer1ms316 KiB
48Wrong answer1ms316 KiB
49Wrong answer1ms316 KiB
50Wrong answer1ms316 KiB
51Wrong answer1ms508 KiB
52Wrong answer1ms508 KiB
53Wrong answer2ms568 KiB
54Wrong answer2ms756 KiB
55Wrong answer2ms564 KiB
56Wrong answer2ms508 KiB
57Wrong answer2ms316 KiB
58Wrong answer2ms316 KiB
59Wrong answer96ms9868 KiB
60Wrong answer97ms9860 KiB
61Wrong answer103ms9952 KiB
62Wrong answer101ms9864 KiB
63Wrong answer98ms9952 KiB
64Wrong answer97ms9952 KiB
65Wrong answer100ms9904 KiB
66Wrong answer101ms9952 KiB
67Wrong answer96ms9948 KiB
68Wrong answer96ms9952 KiB
69Wrong answer94ms10068 KiB
70Wrong answer104ms9864 KiB
71Wrong answer90ms9952 KiB
72Wrong answer94ms9864 KiB
73Wrong answer90ms9868 KiB
74Wrong answer97ms9864 KiB
75Wrong answer104ms11400 KiB
76Wrong answer90ms7656 KiB
77Wrong answer63ms5204 KiB
78Wrong answer92ms7656 KiB
79Wrong answer83ms6036 KiB
80Wrong answer94ms7912 KiB
81Wrong answer94ms7864 KiB
82Wrong answer94ms7912 KiB
83Wrong answer108ms11488 KiB
84Wrong answer68ms5292 KiB
85Wrong answer89ms6124 KiB
86Wrong answer98ms8076 KiB
87Wrong answer100ms8164 KiB
88Wrong answer101ms8160 KiB
89Accepted97ms8160 KiB