17 solutions

  • 1
    @ 2022-1-1 22:14:26

    随便写写

    #include<iostream>
    #include<string.h>
    using namespace std;
    char arr[1005];
    int main()
    {
    	int num=0;
    	cin>>arr;
    	for(int i=0;i<strlen(arr);i++)
    	{
    		if(arr[i]==')') num++;
    		if(arr[i]=='(') num--;
    	}
    	if(num==0) cout<<"YES";
    	else cout<<"NO";
    	return 0;
    }
    

    Information

    ID
    289
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    5
    Tags
    # Submissions
    234
    Accepted
    87
    Uploaded By