-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2160.cpp
More file actions
60 lines (57 loc) · 1.3 KB
/
2160.cpp
File metadata and controls
60 lines (57 loc) · 1.3 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// 2160. 그림 비교
// 2021.10.05
// 구현
#include<iostream>
#include<vector>
#include<string>
using namespace std;
// 그림을 나타내는 구조체
struct Drawing
{
string s[7];
};
int main()
{
int n;
cin >> n;
vector<Drawing> v;
for (int i = 0; i < n; i++)
{
Drawing drawing;
for (int j = 0; j < 5; j++)
{
cin >> drawing.s[j];
}
v.push_back(drawing);
}
int maxCount = -1;
int first = 0;
int second = 0;
for (int i = 0; i < v.size() - 1; i++)
{
for (int j = i + 1; j < v.size(); j++)
{
int count = 0;
for (int k = 0; k < 5; k++)
{
for (int l = 0; l < 7; l++)
{
// 값이 같다면 비슷함의 정도 증가
if (v[i].s[k][l] == v[j].s[k][l])
{
count++;
}
}
}
// 비슷함의 정도가 기존의 값보다 크면 두개의 인덱스를 차례로 저장
if (maxCount < count)
{
maxCount = count;
first = i + 1;
second = j + 1;
}
}
}
cout << first << " " << second << endl;
return 0;
}