如題,第二題輸入時會回報以下錯誤:
您的程式被監控系統中斷,可能是程式無法正常結束所導致。 Traceback (most recent call last): File "/13221113_e524/code_13221113.py", line 2, in N = int(input()) File "/usr/lib/python3.6/codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position ...
此問題應來源於輸入文字檔的編碼錯誤。不知道是否能請題目上傳者修正?謝謝!
如題,第二題輸入時會回報以下錯誤:
您的程式被監控系統中斷,可能是程式無法正常結束所導致。 Traceback (most recent call last): File "/13221113_e524/code_13221113.py", line 2, in N = int(input()) File "/usr/lib/python3.6/codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position ...此問題應來源於輸入文字檔的編碼錯誤。不知道是否能請題目上傳者修正?謝謝!
import sys import codecs sys.stdin = codecs.getreader('latin-1')(sys.stdin.detach())