아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Cactus cutting

시간 제한15초메모리 제한256 MB

요약
선인장 그래프의 모든 간선을 한 끝점을 공유하는 쌍으로 나누는 서로 다른 방법의 수를 10^6+3으로 나눈 나머지를 구한다.
난이도

보통10점 중 7점

유형
그래프, DFS, 동적 계획법, 조합론
정답자
아직 제출이 없습니다

문제

Mr Malnar has given up on his tree obsession and found something even more interesting, cacti! Formally, a cactus is a connected graph where each edge is contained in at most one cycle. A cycle is defined as a sequence of more than one distinct edge in which every two consecutive edges share a common endpoint, and the first and last edge share a common endpoint as well.

Unfortunately, the cactus that Mr Malnar bought is rather big, so he would like to cut it up into disjoint sticks. One stick is defined as a pair of edges that share a common endpoint. Mr Malnar is a pedantic individual, so he wants to know the exact number of ways he can cut up his cactus into sticks.

입력

The first line contains the number of vertices NN and the number of edges MM. This is followed by MM lines, each containing two distinct integers A_iA\_i and B_iB\_i denoting an edge between vertices A_iA\_i and B_iB\_i. Each edge will be listed exactly once.

출력

Compute the number of distinct ways Mr Malnar can cut his cactus up into sticks. Since this number can get quite large, output the result modulo 106+310^6 + 3.

제한

  • 1≤N,M≤100,0001 ≤ N, M ≤ 100\\,000
  • 1≤A_i,B_i≤N1 ≤ A\_i , B\_i ≤ N

예제1

  1. 예제 1

    입력
    10 12
    1 6
    2 5
    7 2
    8 9
    8 1
    2 6
    4 3
    4 10
    3 10
    3 9
    1 3
    5 7
    
    예상 출력
    8