-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2422.cpp
More file actions
42 lines (39 loc) · 810 Bytes
/
2422.cpp
File metadata and controls
42 lines (39 loc) · 810 Bytes
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
// 2422. 한윤정이 이탈리아에 가서 아이스크림을 사먹는데
// 2021.11.06
// 브루트 포스
#include<iostream>
using namespace std;
int n, m;
bool visit[205][205];
int main()
{
cin >> n >> m;
for (int i = 0; i < m; ++i)
{
int p, q;
cin >> p >> q;
visit[p][q] = 1;
visit[q][p] = 1;
}
int ans = 0;
for (int i = 1; i <= n; ++i)
{
for (int j = i + 1; j <= n; ++j)
{
if (visit[i][j])
{
continue;
}
for (int k = j + 1; k <= n; ++k)
{
if (visit[j][k] || visit[k][i])
{
continue;
}
ans++;
}
}
}
cout << ans << endl;
return 0;
}