PS/Baekjoon Online Judge

[백준 06784] Multiple Choice [Python]

kimyoungrok 2024. 8. 6. 12:35
728x90

문제

Your teacher likes to give multiple choice tests. One benefit of giving these tests is that they are easy to mark, given an answer key. The other benefit is that students believe they have a one-in-five chance of getting the correct answer, assuming the multiple choice possibilities are A,B,C,D or E.

Write a program that your teacher can use to grade one multiple choice test.

입력

The input will contain the number N (0 < N < 10000) followed by 2N lines. The 2N lines are composed of N lines of student responses (with one of A,B,C,D or E on each line), followed by N lines of correct answers (with one of A,B,C,D or E on each line), in the same order as the student answered the questions (that is, if line i is the student response, then line N +i contains the correct answer to that question).

출력

Output the integer C (0 ≤ C ≤ N) which corresponds to the number of questions the student answered correctly.


풀이

주어지는 2N개의 정답과 학생이 고른 답안을 비교해 학생이 정답을 맞춘 문항의 갯수를 출력하는 문제다.

정수 N과 2N에 걸쳐 입력을 받아주자. 

올바른 정답과 학생이 고른 답안을 비교하며 동일한 문항의 갯수를 세주면 된다.


소스코드

보기


출처

https://www.acmicpc.net/problem/6784

728x90