172102025-06-03 15:50:39ercseferencSzimmetrikus sorozatcpp17Wrong answer 0/1001ms508 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;
    ifstream f("szamok.txt");
    int n,x,y; f>>n;
    vector<adatszam>a(n);
    for(int i=0; i<n; i++){f>>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++){
                cout<<0;
                /*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;*/
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms316 KiB
2Wrong answer1ms316 KiB
subtask20/9
3Wrong answer1ms316 KiB
4Wrong answer1ms316 KiB
5Wrong answer1ms316 KiB
6Wrong answer1ms316 KiB
7Wrong answer1ms316 KiB
subtask30/14
8Wrong answer1ms316 KiB
9Wrong answer1ms316 KiB
10Wrong answer1ms316 KiB
11Wrong answer1ms316 KiB
12Wrong answer1ms344 KiB
13Wrong answer1ms316 KiB
subtask40/25
14Wrong answer1ms316 KiB
15Wrong answer1ms316 KiB
16Wrong answer1ms316 KiB
17Wrong answer1ms316 KiB
18Wrong answer1ms316 KiB
19Wrong answer1ms316 KiB
20Wrong answer1ms500 KiB
21Wrong answer1ms316 KiB
subtask50/22
22Wrong answer1ms316 KiB
23Wrong answer1ms316 KiB
24Wrong answer1ms508 KiB
25Wrong answer1ms316 KiB
26Wrong answer1ms316 KiB
27Wrong answer1ms316 KiB
28Wrong answer1ms316 KiB
29Wrong answer1ms316 KiB
30Wrong answer1ms316 KiB
31Wrong answer1ms316 KiB
32Wrong answer1ms508 KiB
33Wrong answer1ms316 KiB
34Wrong answer1ms316 KiB
35Wrong answer1ms316 KiB
36Wrong answer1ms316 KiB
37Wrong answer1ms316 KiB
subtask60/30
38Wrong answer1ms500 KiB
39Wrong answer1ms316 KiB
40Wrong answer1ms316 KiB
41Wrong answer1ms316 KiB
42Wrong answer1ms316 KiB
43Wrong answer1ms316 KiB
44Wrong answer1ms316 KiB
45Wrong answer1ms316 KiB
46Wrong answer1ms316 KiB
47Wrong answer1ms316 KiB
48Wrong answer1ms316 KiB
49Wrong answer1ms344 KiB
50Wrong answer1ms316 KiB
51Wrong answer1ms316 KiB
52Wrong answer1ms316 KiB
53Wrong answer1ms316 KiB
54Wrong answer1ms316 KiB
55Wrong answer1ms316 KiB
56Wrong answer1ms316 KiB
57Wrong answer1ms500 KiB
58Wrong answer1ms316 KiB
59Wrong answer1ms316 KiB
60Wrong answer1ms316 KiB
61Wrong answer1ms508 KiB
62Wrong answer1ms316 KiB
63Wrong answer1ms316 KiB
64Wrong answer1ms316 KiB
65Wrong answer1ms316 KiB
66Wrong answer1ms316 KiB
67Wrong answer1ms316 KiB
68Wrong answer1ms316 KiB
69Wrong answer1ms508 KiB
70Wrong answer1ms316 KiB
71Wrong answer1ms316 KiB
72Wrong answer1ms316 KiB
73Wrong answer1ms316 KiB
74Wrong answer1ms316 KiB
75Wrong answer1ms316 KiB
76Wrong answer1ms500 KiB
77Wrong answer1ms316 KiB
78Wrong answer1ms316 KiB
79Wrong answer1ms316 KiB
80Wrong answer1ms316 KiB
81Wrong answer1ms508 KiB
82Wrong answer1ms316 KiB
83Wrong answer1ms316 KiB
84Wrong answer1ms316 KiB
85Wrong answer1ms500 KiB
86Wrong answer1ms316 KiB
87Wrong answer1ms316 KiB
88Wrong answer1ms316 KiB
89Wrong answer1ms316 KiB