Logo
(追記) (追記ここまで)

27135번 - Traveling Cows 다국어채점 준비 중

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB0000.000%

문제

N (3 ≤ N ≤ 400) fields numbered 1..N are connected by P (1 ≤ P ≤ 10,000) bidirectional pathways. Fields 1 and 2 contain barns. Bessie wants to travel on the paths back and forth between these two barns as many times as possible -- however, she doesn't want to visit any field more than one time in all her trips (except for the fields containing barns). Bessie must visit at least one non-barn field when traveling between the two barns; the input set contains neither "1 2" nor "2 1".

What is the maximum number of trips Bessie can make?

입력

  • Line 1: Two integers: N and P
  • Lines 2..P+1: Two integers that represent two fields connected by a path

출력

A single integer that is the maximum number of trips that Bessie can make.

제한

예제 입력 1

7 10
1 3
1 5
1 6
2 4
2 5
2 7
3 4
3 5
5 7
6 7

예제 출력 1

3

힌트

출처

Olympiad > USA Computing Olympiad > 2000-2001 Season > USACO Spring 2001 Contest > Green 4번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /