floyd...太神奇了(不会floyd(大雾)) 貌似floyd的外层k是保证最短路从起点逐渐向外扩展(而不是乱搞233) 所以在处理f[i][j]=min(f[i][j],f[i][k]+f[k][j])的时候,f[i][k]都是已经处理过的,而f[k][j]都是没处理的. 所以这样的话就可以再加1维表示换的次数.(%DP) #include<bits/stdc++.h> #define LL long long #define N 100005 using namespace std;…
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... 其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…
CF memsql Start[c]UP 2.0 A A. Golden System time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Piegirl got bored with binary, decimal and other integer based counting systems. Recently she dis…
CF memsql Start[c]UP 2.0 B B. Distributed Join time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Piegirl was asked to implement two table join operation for distributed database system, minim…