T-coding
백준 2303 숫자 게임 / Python 본문
728x90
728x90
https://www.acmicpc.net/problem/2303
2303번: 숫자 게임
N명이 모여 숫자 게임을 하고자 한다. 각 사람에게는 1부터 10사이의 수가 적혀진 다섯 장의 카드가 주어진다. 그 중 세 장의 카드를 골라 합을 구한 후 일의 자리 수가 가장 큰 사람이 게임을 이
www.acmicpc.net

코드
더보기
from itertools import combinations
n = int(input())
arr = [list(map(int, input().split())) for _ in range(n)]
ans = 0
ans_max = 0
for i in range(n):
combi = list(combinations(arr[i], 3))
temp = 0
for j in combi:
temp = max(temp, sum(j) % 10)
if temp >= ans_max:
ans = i + 1
ans_max = temp
print(ans)
728x90
300x250
'Baekjoon' 카테고리의 다른 글
백준 1021 회전하는 큐 / Python (1) | 2023.05.10 |
---|---|
백준 2535 아시아 정보올림피아드 / Python (0) | 2023.03.27 |
백준 14670 병약한 영정 / Python (0) | 2023.03.24 |
백준 15720 카우버거 / Python (0) | 2023.03.23 |
백준 17413 단어 뒤집기 2 / Python (0) | 2023.03.22 |