Submission #2942354


Source Code Expand

Copy
a = gets.to_i
S = gets.chomp
if a == 0
    puts 'Yes'
    exit
end
S.chars do |c|
    a += c == '+' ? 1 : -1
    if a == 0
        puts 'Yes'
        exit
    end
end
puts 'No'

Submission Info

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