HOME
PROBLEM
STATUS
CONTEST
练习
积分
趣味
正式
DIY
RANK
荣誉榜
活跃榜
现役榜
组队榜
DISCUSS
CHALLENGE
MALL
Register
Login
Counting Stars
TimeLimit:2000MS MemoryLimit:32768KB
64-bit integer IO format:
%I64d
未提交
|
登录后收藏
Problem Description
Little A is an astronomy lover, and he has found that the sky was so beautiful!
So he is counting stars now!
There are n stars in the sky, and little A has connected them by m non-directional edges.
It is guranteed that no edges connect one star with itself, and every two edges connect different pairs of stars.
Now little A wants to know that how many different "A-Structure"s are there in the sky, can you help him?
An "A-structure" can be seen as a non-directional subgraph G, with a set of four nodes V and a set of five edges E.
If $V=(A,B,C,D)$ and $E=(AB,BC,CD,DA,AC)$, we call G as an "A-structure".
It is defined that "A-structure" $G_1=V_1+E_1$ and $G_2=V_2+E_2$ are same only in the condition that $V_1=V_2$ and $E_1=E_2$.
Input
There are no more than 300 test cases.
For each test case, there are 2 positive integers n and m in the first line.
$2\le n \le 10^5$, $1 \le m \le min(2 \times 10^5,\frac{n(n-1)}{2})$
And then m lines follow, in each line there are two positive integers u and v, describing that this edge connects node u and node v.
$1 \leq u,v \leq n$
$\sum{n} \leq 3 \times 10^5$,$\sum{m} \leq 6 \times 10^5$
Output
For each test case, just output one integer--the number of different "A-structure"s in one line.
SampleInput
4 5 1 2 2 3 3 4 4 1 1 3 4 6 1 2 2 3 3 4 4 1 1 3 2 4
SampleOutput
1 6
Submit
题目统计信息
详细
总AC数
1
通过人数
1
尝试人数
1
总提交量
1
AC率
100.00%
标签——3013
name
rating
图论
1017
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签
出处
【每日一题】2023年1月
T^T Online Judge
[
BUG反馈
] [
FAQ
] [
闽ICP备17026590号-1
]
当前版本:
3.24
系统时间: