53582023-04-26 13:15:02horvathabelZárójelekcpp17Wrong answer 20/10027ms5468 KiB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin>>n;
    vector<pair<int, int>> v;
    int check=0;
    for (int i=0; i<n;i++){
        string a;
        cin>>a;
        int num=0;
        for (char x:a){
            if (x==')') num--;
            else num++;
        }
        check+=num;
        v.push_back({num,i+1});
    }

    sort(v.begin(), v.end());
    if (check!=0){
        cout<<-1;
        return 0;
    }
    for (int i=n-1;i>=0;i--){
        cout<<v[i].second<<" ";
    }
    }
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1812 KiB
2Wrong answer8ms2080 KiB
subtask20/11
3Accepted3ms2264 KiB
4Wrong answer3ms2332 KiB
5Accepted3ms2524 KiB
6Accepted2ms2608 KiB
7Accepted7ms3240 KiB
8Wrong answer7ms3192 KiB
subtask36/6
9Accepted8ms2980 KiB
10Accepted8ms3196 KiB
11Accepted8ms3280 KiB
subtask414/14
12Accepted8ms3484 KiB
13Accepted8ms3580 KiB
subtask50/23
14Wrong answer8ms3712 KiB
15Wrong answer8ms3788 KiB
subtask60/19
16Wrong answer7ms3872 KiB
17Wrong answer7ms3896 KiB
18Wrong answer8ms3996 KiB
19Wrong answer8ms4088 KiB
20Wrong answer8ms4092 KiB
21Wrong answer6ms4140 KiB
22Wrong answer6ms4340 KiB
23Wrong answer6ms4300 KiB
24Wrong answer6ms4300 KiB
subtask70/27
25Wrong answer7ms4288 KiB
26Wrong answer8ms4244 KiB
27Wrong answer8ms4236 KiB
28Wrong answer8ms4496 KiB
29Accepted10ms4596 KiB
30Wrong answer27ms5468 KiB
31Wrong answer8ms4364 KiB
32Wrong answer8ms4476 KiB
33Wrong answer8ms4384 KiB
34Wrong answer9ms4424 KiB
35Wrong answer7ms4324 KiB
36Wrong answer9ms4788 KiB
37Wrong answer7ms4652 KiB
38Wrong answer7ms4736 KiB
39Wrong answer14ms5308 KiB
40Wrong answer4ms4764 KiB
41Wrong answer3ms4584 KiB
42Wrong answer7ms4936 KiB
43Wrong answer6ms4812 KiB