Submission #5541205


Source Code Expand

Copy
a=int(input())
s=list(input())
cnt=0
if a==0:
  print('Yes')
else:
  cnt=a
  for i in range(len(s)):
    if s[i] == '+':
      cnt +=1
    elif s[i] == '-':
      cnt -=1
    if cnt ==0:
    	print('Yes')
    	break
if cnt>0:
  print('No')

Submission Info

Submission Time
Task B - セキュリティ
User galileo15640215
Language PyPy3 (2.4.0)
Score 200
Code Size 255 Byte
Status
Exec Time 183 ms
Memory 38256 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 s1.txt, s2.txt, s3.txt
All 200 / 200 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt 168 ms 38256 KB
02.txt 166 ms 38256 KB
03.txt 171 ms 38256 KB
04.txt 171 ms 38256 KB
05.txt 169 ms 38256 KB
06.txt 168 ms 38256 KB
07.txt 168 ms 38256 KB
08.txt 169 ms 38256 KB
09.txt 168 ms 38256 KB
10.txt 172 ms 38256 KB
11.txt 183 ms 38256 KB
12.txt 171 ms 38256 KB
13.txt 169 ms 38256 KB
14.txt 175 ms 38256 KB
s1.txt 171 ms 38256 KB
s2.txt 169 ms 38256 KB
s3.txt 170 ms 38256 KB