101842024-03-29 11:11:06111Zárójelekcpp17Wrong answer 20/10019ms12020 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N;
	cin>>N;
	vector<pair<int,int>>v(N);
	int x=0;
	for(int i=0;i<N;i++){
		string S;
		cin>>S;
		int y=count(S.begin(),S.end(),'(')-count(S.begin(),S.end(),')');
		x+=y;
		v[i]={y,i};
	}
	if(x!=0){
		cout<<-1<<'\n';
		return 0;
	}
	sort(v.rbegin(),v.rend());
	for(auto[_,i]:v){
		cout<<i+1<<' ';
	}
	cout<<'\n';
	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1828 KiB
2Wrong answer4ms2368 KiB
subtask20/11
3Accepted3ms2432 KiB
4Wrong answer3ms2652 KiB
5Accepted3ms2864 KiB
6Accepted3ms2956 KiB
7Accepted3ms3752 KiB
8Wrong answer4ms4072 KiB
subtask36/6
9Accepted4ms4120 KiB
10Accepted3ms4200 KiB
11Accepted4ms4532 KiB
subtask414/14
12Accepted4ms4756 KiB
13Accepted4ms5044 KiB
subtask50/23
14Wrong answer4ms5224 KiB
15Wrong answer4ms5420 KiB
subtask60/19
16Wrong answer4ms5716 KiB
17Wrong answer4ms6192 KiB
18Wrong answer4ms6420 KiB
19Wrong answer4ms6624 KiB
20Wrong answer4ms6828 KiB
21Wrong answer4ms7068 KiB
22Wrong answer4ms7200 KiB
23Wrong answer4ms7176 KiB
24Wrong answer4ms7572 KiB
subtask70/27
25Wrong answer3ms7708 KiB
26Wrong answer4ms7920 KiB
27Wrong answer4ms8256 KiB
28Wrong answer4ms8556 KiB
29Accepted7ms8916 KiB
30Wrong answer19ms10288 KiB
31Wrong answer4ms9488 KiB
32Wrong answer4ms9652 KiB
33Wrong answer4ms9832 KiB
34Wrong answer4ms10076 KiB
35Wrong answer4ms10344 KiB
36Wrong answer6ms10976 KiB
37Wrong answer4ms11076 KiB
38Wrong answer4ms11388 KiB
39Wrong answer9ms11992 KiB
40Wrong answer3ms11780 KiB
41Wrong answer3ms11764 KiB
42Wrong answer4ms12020 KiB
43Wrong answer4ms11980 KiB