115732024-10-27 08:50:55chucknorrisBob Baba Zárójelsorozatacpp17Wrong answer 20/1004ms560 KiB
// NOTE: it is recommended to use this even if you don't understand the following code.

#include <fstream>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
    // uncomment the two following lines if you want to read/write from files
    // ifstream cin("input.txt");
    // ofstream cout("output.txt");

    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int N;
    cin >> N;

    vector<int> A(N);
    for (int i = 0; i < N; ++i)
        cin >> A[i];

    string ans = "";



    if(N == 1) ans = "-1";
    else if(N == 2){
        if(A[0] == A[1]){
            for(int i = 0; i < A[0]; i++) ans = ans + '(';
            for(int i = 0; i < A[0]; i++) ans = ans + ')';
        }
        else ans = "-1";
    }


    cout << ans << endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms320 KiB
2Wrong answer1ms320 KiB
3Accepted1ms320 KiB
subtask220/20
4Accepted1ms320 KiB
5Accepted1ms320 KiB
6Accepted4ms320 KiB
subtask30/30
7Wrong answer1ms320 KiB
8Wrong answer1ms496 KiB
9Wrong answer1ms324 KiB
10Wrong answer1ms324 KiB
11Wrong answer1ms320 KiB
subtask40/50
12Wrong answer1ms320 KiB
13Wrong answer1ms320 KiB
14Wrong answer1ms320 KiB
15Wrong answer1ms320 KiB
16Wrong answer1ms320 KiB
17Wrong answer1ms500 KiB
18Wrong answer1ms320 KiB
19Wrong answer1ms380 KiB
20Wrong answer1ms380 KiB
21Wrong answer1ms320 KiB
22Wrong answer1ms320 KiB
23Wrong answer1ms560 KiB
24Wrong answer1ms320 KiB
25Wrong answer1ms508 KiB
26Wrong answer1ms320 KiB
27Wrong answer1ms320 KiB
28Wrong answer1ms512 KiB
29Wrong answer1ms320 KiB
30Wrong answer1ms320 KiB
31Wrong answer1ms520 KiB
32Wrong answer1ms320 KiB
33Wrong answer1ms320 KiB
34Wrong answer1ms320 KiB
35Wrong answer1ms320 KiB
36Wrong answer1ms420 KiB
37Wrong answer1ms560 KiB
38Wrong answer1ms320 KiB
39Wrong answer1ms320 KiB
40Wrong answer1ms320 KiB
41Wrong answer1ms320 KiB
42Wrong answer1ms376 KiB
43Wrong answer1ms320 KiB
44Wrong answer1ms500 KiB
45Wrong answer1ms500 KiB
46Wrong answer1ms320 KiB
47Wrong answer1ms320 KiB
48Wrong answer1ms508 KiB
49Wrong answer1ms396 KiB
50Wrong answer1ms320 KiB
51Wrong answer1ms320 KiB
52Wrong answer1ms320 KiB
53Wrong answer1ms320 KiB
54Wrong answer1ms320 KiB
55Wrong answer1ms508 KiB
56Wrong answer1ms508 KiB
57Wrong answer1ms332 KiB
58Wrong answer1ms548 KiB