Codeforces 436 C. Dungeons and Candies(二)

2015-07-24 05:48:32 · 作者: · 浏览: 16
er of transferring levels. The levels are numbered 1 through k in the order they follow in the input.

If there are multiple optimal solutions, you can print any of them.

Sample test(s) input
2 3 3 2
A.A
...
A.a
..C
X.Y
...
output
14
1 0
2 1
3 1
input
1 1 4 1
A
.
B
.
output
3
1 0
2 0
4 2
3 0
input
1 3 5 2
ABA
BBB
BBA
BAB
ABB
output
11
1 0
3 1
2 3
4 2
5 1

#include 
  
   
#include 
   
     #include 
    
      #include 
     
       #include 
      
        using namespace std; struct Edge { int u,v,w; }edge[1100*1100]; bool cmp(Edge a,Edge b) { return a.w
       
         vc[1100]; int get_diff(char a[][20],char b[][20] ) { int ret=0; for(int i=0;i