Coder Social home page Coder Social logo

vision-exercises's Introduction

vision-exercises

Một người giàu có đến từ thành Babylon muốn sở hữu một nơi đáng sống nhất. Anh ta muốn một nơi đáng sống nhất phải thuận tiện đi lại từ thành phố này qua thành phố khác và không bị hạn chế di chuyển. Bạn trong vai người tư vấn, hãy nghị cho anh ta một nơi rộng nhất, tức là nơi có nhiều thành phố nhất, và có thể di chuyển bất cứ đâu trong thành phố. Hãy đề nghị anh ta số thành phố mà anh ta có thể sở hữu.

Input:

C : tổng số  thành phố
R : tổng số  con đường
X Y: đường hai chiều từ thành phố X tới thành phố  Y

Điều kiện
0 < C <= 10000
0 < R <= 49995000
0 < X, Y <= 10000, X != Y

Output:

M : số thành phố  (nơi đáng sống nhất) người đến từ Babylon có thể mua.
0 < M <= 10000
Ví dụ 1:

Input:

3
2
1 2
2 3

Output:

3
Ví dụ 2:

Input:

7
8
4 5
5 6
6 4
1 2
2 3
1 3
7 3
7 1

Output:

4

Giải thích:

Ví dụ 1: Cho 3 thành phố  đều có đường kết nối giữa các thành phố  nên kết quả là 3
Ví dụ 2: Cho 7 thành phố, và 8 đường kết nối, đường 4, 5, 6 có thể đi qua lại, đường 1,2,3,7 có thể qua lại 
         Kết quả là 4

vision-exercises's People

Contributors

hoaixuimay avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.