WormholesTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 25394 Accepted: 9083DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that
The PeanutsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 6863 Accepted: 2834DescriptionMr. Robinson and his pet monkey Dodo love peanuts very much. One day while they were having a walk on a country road, Dodo found a sign by the road,
D. Greg and Graphtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGreg has a weighed directed graph, consisting of n vertices. In this graph any pair of distinct vertices has an edge between them
Problem B: Audiophobia Consider yourself lucky! Consider yourself lucky to be still breathing and having fun participating in this contest. But we apprehend that many of your descendants may not have this luxury. For, as you know, we are the
題目大意:兔子和烏龜賽跑,烏龜可以騎電動車,並且在路途中建立充電站,每次充電消耗t時間,每次充電後可以騎c距離,問比賽結果思路:dp不能只是看i-1充電站的狀態,因為有可能是在之前(0-i-1)的充電站直接充了電就直達當前所在網站的.所以對於每個充電站,要重新掃一遍.dp[i]表示到達i站所用的時間最少是多少.dp[i]一定是由前面的某一個網站充電後到達的最小值.但不一定是i-1這個網站.在0~i-1中的網站到達i網站都可能有兩種狀態:(1)騎電動車+蹬電動車(2)騎電動車 AC
題目大意:有給定的N個人,主角編號13,求最小的報數序號M,使得主角為贏家。報數序列為1,M%N這樣.. 1是第一個出去的網上看的數學方法,各種感覺不爽!覺得演算法中最神奇的就是2分和遞迴了。美妙!數學分析過程網上都有,不解釋了。#include<iostream>using namespace std;int find( int n,int m ){ int s=0; for( int i=2;i<=n;i++ ) s=(s+m)%i; return s+1;}int