A問題 Buying Sweets
1 2 3 4 5 |
x = int(input()) a = int(input()) b = int(input()) print((x-a)%b) |
C問題 Candies
解答
1 2 3 4 5 6 7 8 9 |
n = int(input()) table = [] for i in range(2): table.append(list(map(int,input().split()))) ans = -1 for i in range(n): count = sum(table[0][:i])+sum(table[1][i+1:])+table[0][i]+table[1][i] ans = max(ans, count) print(ans) |
コメント