- Published on
CodeTON Round 5 (Div. 1 + Div. 2)
My Submissions
A - Tenzing and Tsondu
I carefully read the problem, noted down the conditions, built my approach, and observed the sample test cases. I was careful not to make any mistake in haste. In this problem, two arrays were given, and their respective sums after comparison resulted in the answer.
a.cpp
int a[n], b[m], sumA = 0, sumB = 0;
for (int i = 0; i < n; i++)
{
cin >> a[i];
sumA += a[i];
}
for (int i = 0; i < m; i++)
{
cin >> b[i];
sumB += b[i];
}
if (sumA > sumB)
{
cout << "Tsondu" << endl;
}
else if (sumA < sumB)
{
cout << "Tenzing" << endl;
}
else
{
cout << "Draw" << endl;
}I submitted the code and got Wrong answer on pretest 2 verdict. I checked my code, and re-read the problem statement but couldn’t get why it was happening. I moved to the next problem.
This blog is yet to be completed.
Published: Last edited: