https://swexpertacademy.com/main/code/problem/problemDetail.do
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include <iostream>
using namespace std;
int scores[101];
int main()
{
int T;
cin >> T;
for (int test_case = 1; test_case <= T; test_case++)
{
//점수마다 사람 수 배열 초기화
memset(scores, 0, sizeof(scores));
for (int i = 0; i < 1000; i++)
{
int score;
cin >> score;
scores[score]++;
}
int Most = 0;
int result = 0;
for (int i = 1; i < 101; i++)
{
if (scores[i] >= Most)
{
result = i;
Most = scores[i];
}
}
cout << "#" << test_case << " " << result << "\n";
}
return 0;
}
|
cs |
'알고리즘 > SW Expert Academy' 카테고리의 다른 글
[SWEA] 2001. 파리 퇴치 (D2) / C++ (1) | 2023.11.09 |
---|---|
[SWEA] 1959. 두 개의 숫자열 (D2) / C++ (5) | 2023.11.08 |
[SWEA] 5215. 햄버거 다이어트 (D3) / C++ (0) | 2023.11.07 |
[SWEA] 1206. [S/W 문제해결 기본] 1일차 - View (D3) / C++ (1) | 2023.11.01 |
[SWEA] 1859. 백만장자 프로젝트 (D2) / C++ (0) | 2023.11.01 |