前程有光

关注

COW(dp、递推)

前程有光

关注

阅读 54

2022-02-26

题目描述:

在这里插入图片描述

主要思路:

#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    ll c=0,o=0,w=0;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='C') c+=1;
        else if(s[i]=='O') o+=c;
        else w+=o;
    }
    cout<<w<<endl;
    return 0;
}

相关推荐

zhongjh

过河卒--递推+DP

zhongjh 82 0 0

舍予兄

POJ 3267 The Cow Lexicon(DP)

舍予兄 24 0 0

认真的老去

hdu 2050 折线分割平面(递推,dp)

认真的老去 43 0 0

夏木之下

问题 R: 超级楼梯(递推,基础DP)查表

夏木之下 37 0 0

非衣所思

P1472 奶牛家谱 Cow Pedigrees(DP)

非衣所思 58 0 0

小月亮06

【qduoj - 夏季学期创新题】骑士游历(递推dp)

小月亮06 30 0 0

weednoah

hdu 2047 阿牛的EOF牛肉串(递推,dp)

weednoah 33 0 0

elvinyang

USACO Section 2.3 Cow Pedigrees - DP状态还是很好找的.

elvinyang 65 0 0

全栈顾问

2104. 子数组范围和 :「区间 DP」&「递推」&「单调栈」

全栈顾问 31 0 0

江南北

“Catch That Cow“

江南北 155 0 0

精彩评论(0)

0 0 举报