Codeforces Round #724 DIV2 C問題 (1500pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N;
char S[5d5+2];
int x, y, a, b, res[];
HashMap<pair<int,int>,int> hs;
{
REP(rd_int()){
rd(N,S);
x = y = 0;
hs.init(N,0);
rep(i,N){
if[S[i]=='K',x,y]++;
(a,b) = (x,y) / gcd(x,y);
res[i] = ++hs[{a,b}];
}
wt(res(N));
}
}
Current time: 2024年04月26日17時39分24秒
Last modified: 2021年06月07日19時38分54秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF724 CF_DIV2_C
トップページに戻る
Logged in as: unknown user (not login)