2020年12月30日09時48分56秒に更新されたバージョンを表示しています.
最新のページはこちらをご覧ください.
Codeforces Round #692 (based on Technocup 2021 Elimination Round 3) DIV1 C問題 (1250pt)
Codeforces Round #692 (based on Technocup 2021 Elimination Round 3) DIV2 E問題 (2250pt)
Technocup 2021 - Elimination Round 3 E問題 (2250pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N; ll T; char S[1d5+2];
int cnt[26];
{
ll k, x;
rd(N,T,S);
rep(i,N) S[i] -= 'a';
if(N) T -= (1 << S[--N]);
if(N) T += (1 << S[--N]);
rep(i,N) cnt[S[i]]++;
rrep(i,26){
T = abs(T);
x = (1 << i);
k = min(T / x, cnt[i]);
T -= x * k;
cnt[i] = (cnt[i] - k) % 2;
if(cnt[i]) T -= x;
}
wt(if[T==0, "Yes", "No"]);
}
Current time: 2024年04月24日04時34分04秒
Last modified: 2020年12月30日09時48分56秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF692 CF_DIV1_C CF_DIV2_E
トップページに戻る
Logged in as: unknown user (not login)