MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / main

Function main

Codeforces_problems/Good_Number/solution.cpp:5–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3And checked if the iterator returned by the last value of matches with the iterator returned by set end*/
4using namespace std;
5int main(){
6 long n,val,count=0;
7 cin>>n>>val;
8 for(int i=0;i<n;i++){
9 long num;
10 cin>>num;
11 set<int> S;
12 while(num>0){
13 S.insert(num%10);//takes only unique digits of the number
14 num=num/10;
15 }
16 int flag=0;
17 for(int j=0;j<=val;j++){
18 if(S.find(j)==S.end()){
19 flag=1;
20 }
21 }
22 if(!flag){
23 count++;
24 }
25 }
26 cout<<count;
27 return 0;
28}

Callers

nothing calls this directly

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected