Link to the problem: https://usaco.org/index.php?page=viewproblem2&cpid=665
Basically, I tried to run my code, but it says that I have an incorrect answer on the sample input case despite my output and the correct answer matching exactly.
Here is a screenshot of what I am seeing:
As you can see, my output matches the correct answer but it is still considered wrong. Is the problem bugged?
Here is my code:
#include <bits/stdc++.h>
using namespace std;
int main()
{
freopen(“cowsignal.in”, “r”, stdin);
freopen(“cowsignal.out”, “w”, stdout);
int m, n, k;
cin >> m >> n >> k;
for (int i=0; i<m+1; i++) {
string row;
getline(cin, row);
string newrow = "";
for (int j=0; j<n; j++) {
char c = row[j];
for (int h=0; h<k; h++) {
newrow += c;
}
}
for (int a=0; a<k; a++) cout << newrow << endl;
}
return 0;
}