Algorithms/코테 문풀
[백준 2475번] 검증수
hi-rachel
2023. 8. 12. 15:32
문제
https://www.acmicpc.net/problem/2475
2475번: 검증수
컴퓨터를 제조하는 회사인 KOI 전자에서는 제조하는 컴퓨터마다 6자리의 고유번호를 매긴다. 고유번호의 처음 5자리에는 00000부터 99999까지의 수 중 하나가 주어지며 6번째 자리에는 검증수가 들
www.acmicpc.net
풀이
import sys
a, b, c, d, e = map(int, sys.stdin.readline().split())
print((a**2 + b**2 + c**2 + d**2 + e**2) % 10)
- 빠르고 짧은 Pythonic Code
print(sum(int(i)**2 for i in input().split())%10)