#include <iostream>
#include <vector>
using namespace std;
#define int long long
const int N = 1e5 + 10;
vector<int> nei[N];
bool seen[55][55][55];
int Seen[N],cur;
void dfs(int u,vector<int> v){
cur++;
v.push_back(u);
for (int i : v)
seen[v[0]][u][i] = 1,Seen[i] = cur;
for (int i : nei[u])
if (Seen[i] != cur)
dfs(i,v);
}
signed main(){
int n,m;
cin>>n>>m;
for (int i=1;i<=m;i++){
int a,b;
cin>>a>>b;
nei[a].push_back(b);
nei[b].push_back(a);
}
for (int i=1;i<=n;i++)
dfs(i,{});
int ans = 0;
for (int s = 1;s <= n; s++)
for (int c = 1;c <= n; c++)
for (int f = 1;f <= n; f++)
if ( !(s == c or s == f or c == f) )
ans += seen[s][f][c];
cout<<ans<<'\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
3420 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
3420 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
62 ms |
13052 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
6 ms |
6744 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
54 ms |
14420 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
6 ms |
6744 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
56 ms |
14268 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
3420 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
3420 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |