結果
| 問題 |
No.9000 Hello World! (テスト用)
|
| ユーザー |
mamo_ICE
|
| 提出日時 | 2019-04-14 12:32:55 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 5,000 ms |
| コード長 | 1,275 bytes |
| コンパイル時間 | 789 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2024-09-18 18:31:58 |
| 合計ジャッジ時間 | 561 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / 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