contest : CCRC21C
problem : TOTSCR
link to problem : CodeChef: Practical coding for everyone
my solution :
#include<bits/stdc++.h>
using namespace std;
int main()
{ int t;
cin>>t;
while(t>0)
{ int score =0,n,k;
string s =“”;
cin>>n>>k;
int A[k];
for(int i=0;i<k;i++)
cin>>A[i];
for(int j=0;j<n;j++)
{ cin>>s;
int score=0;
for(int k=0;s[k]!='\0';k++)
if(s[k] =='1')
score += A[k];
else
continue;
cout<<score<<'\n';
}
t--;
}
return 0;
}
can anyone explain me how this solution is incorrect. please.