QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#412434#8689. CompressionsupepapupuCompile Error//C++20185b2024-05-16 14:13:062024-05-16 14:13:06

Judging History

你现在查看的是最新测评结果

  • [2024-05-16 14:13:06]
  • 评测
  • [2024-05-16 14:13:06]
  • 提交

answer

s = input()
n = len(s)
if s == '1' * n: print(1)
elif s == '0' * n: print(0)
elif s[0] != s[-1]: print(s[0] + s[-1])
else: print(s[0] + chr(ord('0') + ord('1') - ord(s[0])) + s[0])

Details

answer.code:1:1: error: ‘s’ does not name a type
    1 | s = input()
      | ^