普通的最短路...dijkstra水过.. ------------------------------------------------------------------------------ #include<cstdio> #include<algorithm> #include<cstring> #include<iostream> #include<queue>   #define rep( i , n ) for( int i…
3408: [Usaco2009 Oct]Heat Wave 热浪 Time Limit: 3 Sec  Memory Limit: 128 MBSubmit: 67  Solved: 55[Submit][Status][Discuss] Description Input  第1行:4个由空格隔开的整数T,C,Ts,Te.  第2到第C+1行:第i+l行描述第i条道路.有3个由空格隔开的整数Rs,Re,Ci. Output     一个单独的整数表示Ts到Te的最小费用.数据保证至少存在一条…
链接:https://ac.nowcoder.com/acm/contest/1082/F来源:牛客网 题目描述 The good folks in Texas are having a heatwave this summer. Their Texas Longhorn cows make for good eating but are not so adept at creating creamy delicious dairy products. Farmer John is leadin…
水题,裸的最短路. ; type link=^node; node=record t,d:longint; f:link; end; var n,m,s,i,j,u,v,w,max:longint; adj:array[..] of link; f:array[..] of longint; d,val:array[..] of longint; went:array[..] of boolean; procedure insert(f,t,d:longint); var p:link; beg…
最短路模板.选迪杰. #include<stdio.h> #include<string.h> #include<stdlib.h> #include<algorithm> #include<queue> //#include<iostream> using namespace std; int n,m,s,t; #define maxn 2511 #define maxm 12411 const int inf=0x3f3f3f3f…
P1339 [USACO09OCT]热浪Heat Wave 题目描述 The good folks in Texas are having a heatwave this summer. Their Texas Longhorn cows make for good eating but are not so adept at creating creamy delicious dairy products. Farmer John is leading the charge to delive…
Luogu P1339 热浪Heat Wave 裸·单源最短路. 但是! 有以下坑点: 算过复杂度发现Floyd跑不过去就不要用了. 如果建边是双向边,边的数组大小要开两倍! 考场上如果再把初始化的$dis[i]=INF$写成$dis[n]=INF$,或者忘记$dis[s]=0$之类的话,就直接火葬场了-- #include<bits/stdc++.h> #define N 2510 #define M 6210 #define INF 0x3f3f3f3f using namespace s…
01背包... ----------------------------------------------------------------------- #include<cstdio> #include<algorithm> #include<cstring> #include<iostream>   #define rep( i , n ) for( int i = 0 ; i < n ; i++ ) #define clr( x , c )…
3406: [Usaco2009 Oct]Invasion of the Milkweed 乳草的入侵 Time Limit: 3 Sec  Memory Limit: 128 MBSubmit: 87  Solved: 49[Submit][Status][Discuss] Description Input   第1行:4个由空格隔开的整数X,K Mx,My.     第2到第Y+1行:每行由X个字符描述草地. Output     一个单独的整数表示最后一个不是大石块的格子被乳草占领的星期…
3409: [Usaco2009 Oct]Barn Echoes 牛棚回声 Time Limit: 3 Sec  Memory Limit: 128 MBSubmit: 57  Solved: 47[Submit][Status][Discuss] Description 奶牛们灰常享受在牛栏中哞叫,因为她们可以听到她们哞声的回音.虽然有时候并不能完全听到完整的回音.Bessie曾经是一个出色的秘书,所以她精确地纪录了所有的哞叫声及其回声.她很好奇到底两个声音的重复部份有多长. 输入两个字符串(…