[백준] 2422 한윤정이 이탈리아에 가서 아이스크림을 사먹는데
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int n, m;
cin >> n >> m;
vector<vector<int>> canMix(200, vector<int>(200, 1));
for (int i = 0; i < m; ++i) {
int a, b;
cin >> a >> b;
a--; b--;
canMix[a][b] = 0;
canMix[b][a] = 0;
}
int cnt = 0;
for (int a = 0; a < n; ++a) {
for (int b = a + 1; b < n; ++b) {
if (!canMix[a][b]) continue;
for (int c = b + 1; c < n; ++c) {
if (!canMix[a][c] || !canMix[b][c]) continue;
cnt++;
}
}
}
cout << cnt;
return 0;
}