Submission #2942817

Source Code Expand

Copy
def solve(A,S):
  if A == 0:
    return True
  for c in S:
    if c=='-':
      A -= 1
    else:
      A += 1
    if A == 0:
      return True
  return False

A=int(raw_input())
S=raw_input()
if solve(A,S):
  print 'Yes'
else:
  print 'No'

Submission Info

Submission Time
Task B - セキュリティ
User naoya_t
Language Python2 (2.7.6)
Score 200
Code Size 260 Byte
Status
Exec Time 10 ms
Memory 2568 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 10 ms 2568 KB
02.txt 10 ms 2568 KB
03.txt 10 ms 2568 KB
04.txt 10 ms 2568 KB
05.txt 10 ms 2568 KB
06.txt 10 ms 2568 KB
07.txt 10 ms 2568 KB
08.txt 10 ms 2568 KB
09.txt 10 ms 2568 KB
10.txt 10 ms 2568 KB
11.txt 10 ms 2568 KB
12.txt 10 ms 2568 KB
13.txt 10 ms 2568 KB
14.txt 10 ms 2568 KB
s1.txt 10 ms 2568 KB
s2.txt 10 ms 2568 KB
s3.txt 10 ms 2568 KB