A問題 Good Integer
1 2 3 4 5 6 7 |
s = input() if s[0]==s[1]==s[2] or s[1]==s[2]==s[3]: print('Yes') exit() print('No') |
C問題 Train Ticket
解答
1 2 3 4 5 6 7 8 9 10 11 12 13 |
s = input() for i in range(2**3): f=s[0] for j in range(3): if i>>j &1: f+='+' else: f+='-' f+=s[j+1] if eval(f)==7: print(f + '=7') exit() |
コメント