thanatos_17's blog

By thanatos_17, history, 7 months ago, In English

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

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
7 months ago, # |
  Vote: I like it +14 Vote: I do not like it

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 months ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

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';

}

}