結果
| 問題 | No.9000 Hello World! (テスト用) |
| ユーザー |
|
| 提出日時 | 2026-11-05 06:45:11 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 957 bytes |
| 記録 | |
| コンパイル時間 | 368 ms |
| コンパイル使用メモリ | 14,848 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2026-11-05 06:45:13 |
| 合計ジャッジ時間 | 2,001 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge7_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 4 |
ソースコード
def bf_compiler(code):
mem = [0] * 30000
ptr = head = 0
output = ""
while head < len(code):
c = code[head]
if c == '+': mem[ptr] += 1
elif c == '-': mem[ptr] -= 1
elif c == '>': ptr += 1
elif c == '<': ptr -= 1
elif c == '.': output += chr(mem[ptr])
# ',' has been disabled
elif c == '[' and mem[ptr] == 0:
count = 1
while count:
head += 1
if code[head] == '[': count += 1
elif code[head] == ']': count -= 1
elif c == ']' and mem[ptr] != 0:
count = 1
while count:
head -= 1
if code[head] == ']': count += 1
elif code[head] == '[': count -= 1
head += 1
return output
hw = "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++."
print(bf_compiler(hw))