Tên đăng nhập Điểm ▾ Bài tập Giới thiệu
40601 0 0
40601 0 0
40601 0 0

:>~<: he

40601 0 0
40601 0 0
40601 0 0
40601
Thienan52
NGuyễn Thiện Ân
0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0

chi

40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601
minhquan_lta
Lê Đức Minh Quân
0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601
rei
rei ayanami
0 0

fly me to the moon

40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0

include<bits/stdc++.h>

using namespace std ;
bool ok(string s){
vector <char> t;
t.clear();
for(int i = 0 ; i < (int)s.size() ; i++){
if(s[i] == '(' || s[i] == '[' || s[i] == '{'){
t.push_back(s[i]);
}
else if(s[i] == ')' && t[(int)t.size()-1] != '('){
return false;
}
else if(s[i] == ']' && t[(int)t.size()-1] != '['){
return false;
}
else if(s[i] == '}' && t[(int)t.size()-1] != '{'){
return false;
}
t.pop_back();
}
if (t.empty()) return true;
return false;
}
int main(){
string s; cin >> s;
if(ok(s)) cout << 1;
else cout << 0;
}

40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0

tyn

40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0
40601 0 0