原创 UVA 10539 Almost Prime

Almost prime numbers are the non-prime numbers which are divisible by only a single prime number. In this problem y

原创 uva 315 Network

A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places nu

原创 UVA 532 Dungeon Master

You are trapped in a 3D dungeon and need to nd the quickest way out! The dungeon is composed of unit cubes which m

原创 UVA 469 Wetlands of Florida

A construction company owns a large piece of real estate within the state of Florida. Recently, the company decided

原创 POJ 2062 Card Game Cheater

Adam and Eve play a card game using a regular deck of 52 cards. The rules are simple. The players sit on opposite s

原创 UVA 10452 Marcus

“First, the breath of God. Only the penitent man will pass. Second, the Word of God, Only in the footsteps of Go

原创 uva 10596 Morning Walk

Kamal is a Motashota guy. He has got a new job in Chittagong. So, he has moved to Chittagong from Dinajpur. He was

原创 UVA 260 Il Gioco dell'X

題意: 黑白兩方下棋,必有一人勝出,若黑棋能從第一行走到最後一行則Black勝出,若白棋能從能從第一列走到最後一列則White勝出 思路: 只需判斷Black是否勝出,用dfs搜索黑棋能否能從第一行走到最後一行 #in

原创 UVA 439 Knight Moves

A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to nd the shortest closed to

原创 UVA 572 Oil Deposits

The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works wi

原创 UVA 10706 Number Sequence

A single positive integer i is given. Write a program to find the digit located in the position i in the sequence o

原创 UVA 336 A Node Too Far

題意: 給出點的個數及各個點之間的聯通情況,輸出從某點開始沿聯通圖路線走n步後不能到達的點的個數,0 0結束 思路: 用bfs搜索每個點 #include <iostream> #include <map> #in

原创 UVA 352 The Seasonal War

The inhabitants of Tigerville and Elephantville are engaged in a seasonal war. Last month, Elephantville successful

原创 UVA 170 Clock Patience

題意: 將牌依次分成13堆,牌面朝下,按從1到13的順序發牌,然後從第K堆第一張開始翻牌,然後將該牌放在這一堆的最下面,面朝上,接着翻牌面上顯示的數字那一堆的第一張面朝下的牌,重複此過程,直到所有牌都面朝上,輸出翻牌的次數

原创 UVA 144 Student Grants

The Government of Impecunia has decided to discourage tertiary students by making the payments of tertiary grants a