nyist 740 “炫舞家“ST

网友投稿 732 2022-09-02

nyist 740 “炫舞家“ST

nyist 740 “炫舞家“ST

题目地址:#include #include #include #include #include #include #include #include #include #include const int inf = 0x3f3f3f3f;//1061109567typedef long long LL;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;int a[10010];int dp[10010][5][5];int cost[5][5];int main(){ for(int i=1; i<=4; i++) { cost[0][i] = 2; cost[i][i] = 1; int k = i + 1; if(k == 5) k = 1; cost[i][k] = cost[k][i] = 3; } cost[2][4] = cost[4][2] = 4; cost[1][3] = cost[3][1] = 4; while(true) { memset(dp,0,sizeof(dp)); int k = 0; scanf("%d",&a[k]); if(a[k] == 0) break; k++; while(scanf("%d",&a[k]) && a[k]) { k++; } k--; dp[0][a[0]][0] = 2; dp[0][0][a[0]] = 2; for(int i=1; i

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:nyist 61 传纸条(一)(双线程DP)
下一篇:谈谈我们为什么要前后端分离(前后端分离百度百科)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~