Codeforces Global Round 4 B問題 (750pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
char S[1000001]; int N;
int cnt[1000001];
{
int i, j, k;
ll res = 0;
rd(S@N);
k = 0;
rep(i,N){
if(S[i]=='v'){
if(S[i+1]=='v') S[k++] = 'w';
} else {
S[k++] = S[i];
}
}
N = k;
rep(i,N) cnt[i+1] = cnt[i] if[S[i]=='w', +1];
rep(i,N) if(S[i]=='o'){
res += (ll)cnt[i] * (cnt[N] - cnt[i]);
}
wt(res);
}
Current time: 2024年04月20日02時42分03秒
Last modified: 2019年07月21日15時39分32秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces Codeforces_Global_Round_4
トップページに戻る
Logged in as: unknown user (not login)