//problem no. 110305
//porównywanie wiersz po wierszu a nie wszystko naraz
#include <iostream>
#include <ctype.h>
#include <string>
using namespace std;
enum Verdict
{
AC,
PE,
WA
};
int main()
{
int n, m,
run = 0;
cin>>n;
cin.get();
Verdict verd;
while (n != 0)
{
verd = AC;
++run;
string digits1;
string chars1;
string digits2;
string chars2;
int *counts = new int [n];
for (int i=0; i<n; i++)
counts[i] = 0;
char c;
int i = 0;
while (i < n)
{
c = cin.get();
if (c == '\n')
i++;
counts[i]++;
if (isdigit(c))
digits1 += c;
else
chars1 += c;
}
cin>>m;
cin.get();
i = 0;
int *counts2 = new int [m];
for (int i=0; i<m; i++)
counts2[i] = 0;
while (i < m)
{
c = cin.get();
if (c == '\n')
i++;
counts2[i]++;
if (isdigit(c))
digits2 += c;
else
chars2 += c;
}
if (n != m)
verd = PE;
for (int i=0; i<n, i<m; i++)
if (counts[i] != counts2[i])
verd = PE;
if (digits1 != digits2)
verd = WA;
else
{
if (chars1 != chars2)
verd = PE;
}
switch (verd)
{
case WA:
cout<<"Run #"<<run<<": Wrong answer"<<endl;
break;
case PE:
cout<<"Run #"<<run<<": Presentatnio error"<<endl;
break;
default:
cout<<"Run #"<<run<<": Accepted"<<endl;
}
cin>>n;
cin.get();
}
return 0;
}
what do I do wrong? Or when my program make mistakes?
And btw @kabanek wtf is a "Presentatnio error" in your Code? Also in "Wrong answer" a should be capital (Wrong Answer). Plus your code doesn't show correct outputs.
You tried your best and you failed miserably. The lesson is 'never try'. -Homer Simpson
metaphysis wrote:a solution is PE means every line PE.
a solution is WA means at least one line WA.
a solution is AC means All characters must match and must occur in the same order.
a solution is PE means All numeric characters match in the same order, but there is at least ONE non-matching non-numeric character.
for example:
3
The answer is: 10
The answer is: 5
The answer is: 5
3
The answer is: 1
The answer is: 05
The answer is: 5
0
you should output "Run #1: Presentation Error".
a solution is WA means it is not AC or PE.
sorry for my misunderstanding of this problem previously.
I keep getting WA and I have tried all the sample cases provided in the above threads. They work fine on my system. Please somebody do tell whats wrong with my submission.