結果
| 問題 | No.9000 Hello World! (テスト用) |
| ユーザー |
mamo_ICE
|
| 提出日時 | 2019-04-14 12:32:55 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 83 ms / 5,000 ms |
| コード長 | 1,275 bytes |
| 記録 | |
| コンパイル時間 | 127 ms |
| コンパイル使用メモリ | 77,252 KB |
| 最終ジャッジ日時 | 2025-12-04 01:34:41 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
# coding: utf-8
# !/usr/bin/python
# クラス定義
class HelloWorld(object):
'''
HelloWorldのコンテキストクラス
'''
def __enter__(self):
'''
__enter__
'''
self.__out = ''
self.__string = ['0x48', '0x65', '0x6c', '0x6c', '0x6f', '0x20',
'0x57', '0x6f', '0x72', '0x6c', '0x64', '0x21']
return self
def __exit__(self, exc_type, exc_value, traceback):
'''
__exit__
'''
print(self.__out)
return True
def get_out(self):
'''
outのゲッター
'''
return self.__out
def set_out(self, asc):
'''
outのセッター
'''
self.__out += chr(int(asc, 16))
def get_string(self):
'''
stringのゲッター
'''
return self.__string
# propertyの設定
out = property(get_out, set_out)
string = property(get_string)
# メインの処理
def main():
count = ans = 0
with HelloWorld() as hello:
while True:
ans = hello.string[count]
hello.out = ans
count += 1
# 直接呼び出されているか
if __name__ == '__main__':
main()
else:
print('Hello World!')
mamo_ICE