for this problem(CSUB Problem - CodeChef) i am continuously getting runtime error SIGSEGV
here is code
#include<bits/stdc++.h>
using namespace std;
#define ll long int
int main()
{
ll t;
cin>>t;
while(t–)
{
ll n;
string s;
cin>>n;
cin>>s;
ll count=0,k=1,i;
for(i=0;i<n;i++)
{
if(s[i]==‘1’)
{
count=count+k;
k++;
}
}
cout<<count<<endl;
}
return 0;
}
please mark out the error
thank in advance