회원가입
로그인
Toggle navigation
문제
문제
전체 문제
문제 출처
단계별로 풀어보기
알고리즘 분류
추가된 문제
문제 순위
문제
푼 사람이 한 명인 문제
아무도 못 푼 문제
최근 제출된 문제
최근 풀린 문제
랜덤
출처
ICPC
Olympiad
한국정보올림피아드
한국정보올림피아드시․도지역본선
전국 대학생 프로그래밍 대회 동아리 연합
대학교 대회
카카오 코드 페스티벌
Coder's High
ICPC
Regionals
World Finals
Korea Regional
Africa and the Middle East Regionals
Europe Regionals
Latin America Regionals
North America Regionals
South Pacific Regionals
문제집
대회
채점 현황
게시판
그룹
더 보기
재채점 기록
블로그
도움말
전체
공지
자유
질문
오타/오역/요청
게시판 공지
홍보
업데이트
solved.ac
글쓰기
질문 도움말
자주묻는 질문
무엇이 틀렸을까요???
2456번 - 나는 학급회장이다
bella0402
1년 전
0
반례는 알겠는데 왜 틀린지 모르겠어요
어떤 게 틀린지 알려주시면 감사하겠습니다~~
import sys num = int(sys.stdin.readline().rstrip()) student_list = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] for _ in range(num): score = list(map(int, sys.stdin.readline().rstrip().split())) student_list[0][score[0] - 1] += 1 student_list[1][score[1] - 1] += 1 student_list[2][score[2] - 1] += 1 for i in range(3): total_score = student_list[i][0] + student_list[i][1] * 2 + student_list[i][2] * 3 student_list[i].append(total_score) max_index2 = student_list.index(max(student_list, key = lambda x : x[2])) max_index1 = student_list.index(max(student_list, key = lambda x : x[1])) max_index0 = student_list.index(max(student_list, key = lambda x : x[0])) if student_list.count(max(student_list, key = lambda x : x[2])) == 1: print(max_index2 + 1, student_list[max_index2][3]) elif student_list.count(max(student_list, key = lambda x : x[1])) == 1: print(max_index1 + 1, student_list[max_index1][3]) elif student_list.count(max(student_list, key = lambda x : x[0])) == 1: print(max_index0 + 1, student_list[max_index0][3]) else: print(0, max(student_list, key = lambda x : x[3])[3])
댓글을 작성하려면
로그인
해야 합니다.
bella0402 1년 전
반례는 알겠는데 왜 틀린지 모르겠어요
어떤 게 틀린지 알려주시면 감사하겠습니다~~