結果
問題 | No.9000 Hello World! (テスト用) |
ユーザー | kimiyuki |
提出日時 | 2018-03-23 18:20:23 |
言語 | Bash (Bash 5.1.16) |
結果 |
RE
|
実行時間 | - |
コード長 | 51,955 bytes |
コンパイル時間 | 53 ms |
コンパイル使用メモリ | 6,948 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 21:32:30 |
合計ジャッジ時間 | 861 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
ソースコード
PNG ��� IHDR���E������k���StEXtComment�= :;: <<'a86e4bb8062f308935461bdd23d2bf0dc3a24ec37871f6473d06e68e1b3ca58e' HV��GIDATx0D"͇T_Y 8&I @9&W *O&!Ru"-Dг5dya{QYdR8~9dQ{',K]y!f*kT⮿!<vOr�Oc<bBy(oU<KQ .[FigPeǒԍi<xKb ܟ2F/kq1p6�.GVSX1w+@5|8Bj1`^`N&au,ߎp|P&vk!q"Az|!cJsM��tEXt a86e4bb8062f308935461bdd23d2bf0dc3a24ec37871f6473d06e68e1b3ca58e base64 -d <<EOF > Interpreter.pm cGFja2FnZSBQaWV0OjpJbnRlcnByZXRlcjsKCnVzZSA1LjYuMDsgICAjICBvciBzby4KdXNlIHN0cmljdDsKdXNlIENhcnA7CiMgdXNlIEltYWdlOjpNYWdpY2s7CgpvdXIgJFZFUlNJT04gPSAnMC4wMyc7Cgo9aGVhZDEgTkFNRQoKUGlldDo6SW50ZXJwcmV0ZXIgLSBJbnRlcnByZXRlciBmb3IgdGhlIFBpZXQgcHJvZ3JhbW1pbmcgbGFuZ3VhZ2UKCj1oZWFkMSBTWU5PUFNJUwoKICAgIHVzZSBQaWV0OjpJbnRlcnByZXRlcjsKCiAgICBteSAkcCA9IFBpZXQ6OkludGVycHJldGVyLT5uZXcoaW1hZ2UgPT4g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