제출 #1294098

#제출 시각아이디문제언어결과실행 시간메모리
1294098zahra_괄호 문자열 (CEOI16_match)C++20
0 / 100
0 ms332 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long int main(){ string s , ans = ""; cin >> s; if(s.size() % 2 != 0){ cout << -1 << endl; return 0; } else{ ans[0] = '('; for(int i = 1 ;i < s.size() ; i++){ if(s[i] == s[i - 1]){ ans += ')'; } else{ ans += '('; } } } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...