#include #include #include using namespace std; string s, t; int cost[4], t_cost=0, orig_cost = 0, min_cost, s_length, t_length; int car_cost(char car){ switch(car){ case 'A': return cost[0]; break; case 'C': return cost[1]; break; case 'G': return cost[2]; break; case 'T': return cost[3]; break; } } int dec_cost(int t_pos, int s_pos, int tmp_cost){ int eq = 1; while(eq && t_pos> s; fin >> t; //getline(fin,s); //getline(fin,t); for (int i = 0; i<4; i++) fin >> cost[i]; fin.close(); s_length = s.length(); t_length = t.length(); for(int i = 0; i < t_length; i++) t_cost += car_cost(t[i]); orig_cost = t_cost; min_cost = t_cost; calc(); ofstream fout("output.txt"); fout << min_cost << endl; fout.close(); }