LCOLLIS - Editorial

The part with the tmp basically calculates the nC2 value.
In plain words,if n people like 1 girl,then no.of collisions resulting for that girl is nC2.

nC2 =n*(n-1)/2

Bro input is of string type
In problem we have to read character ‘1’ and ‘0’ not seprated by white space …

whereas in integer array its not convenient to read ‘1’ and ‘0’ for that we need whitespace char after each ‘1’, ‘0’ which willl not be provided in authors input file while checking code for AC verdict hence its giving runtime error
Read in form of sttring the following N lines

use getline keyword

#include
#include

int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
std::cout.tie(NULL);
int t;
std::cin >> t;
while (t–)
{
int n, m, count = 0;
double sum = 0;
std::cin >> n >> m;
std::string s[10];
for (int i = 0; i < n; ++i)
{
std::cin >> s[i];
}
for (int i = 0; i < m; ++i)
{
count = 0;
for (int j = 0; j < n; ++j)
{
if (s[i][j] == ‘1’)
{
count++;
}
}
sum = sum + (((count * count) - count) / 2);
}
std::cout << sum << std::endl;
}
}

what ami doing wrong plz tell.