Блог пользователя thanatos_17

Автор thanatos_17, история, 7 месяцев назад, По-английски

submission #2492987279 is getting WA in TEST CASE 16 of Problem 520A https://mirror.codeforces.com/contest/520/submission/242987279 please help

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by thanatos_17 (previous revision, new revision, compare).

»
7 месяцев назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится

Just try to output the string $$$x$$$ after function small and you will find that there's no change.

That's because you forget to add & in string abc so that the changes only perform on $$$abc$$$, not $$$x$$$.

»
7 месяцев назад, # |
Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

You have made it complicated you can just convert all the characters to either uppercase or lowercase and insert them in a set. And then check for the condition whether size is equal to 26 or not. My code:

include<bits/stdc++.h>

using namespace std;

int main(){

int n;

cin>>n;

string s;

cin>>s;

set<char>w;

for(int j=0;j<n;j++){

    if(s[j]<97){

        char c=s[j]-64+96;

        w.insert(c);

    }

    else{

        w.insert(s[j]);

    }
}

if(w.size()==26){

    cout<<"YES"<<'\n';

}
else{

    cout<<"NO"<<'\n';

}

}