結果

問題 No.8126 Brainfxxk easy
コンテスト
ユーザー moon17
提出日時 2026-04-01 22:37:23
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 173 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 539 ms
コンパイル使用メモリ 85,400 KB
実行使用メモリ 137,892 KB
最終ジャッジ日時 2026-04-01 22:37:34
合計ジャッジ時間 4,867 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n=int(input())
s=input()
p=0
a=[0]*n
for c in s:
  if c=='+':
    a[p]+=1
  if c=='-':
    a[p]-=1
  p+=(c=='>')-(c=='<')
  if not 0<=p<n:
    exit(print('error'))
print(*a)
0