ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1718. Rejudge

wa #3 helppppppp pls
Posted by h1ci 1 Dec 2009 02:03
whats wrong could you send some tests pls
if you want source I'll give it
Re: wa #3 helppppppp pls
Posted by h1ci 1 Dec 2009 02:14
CODE:




#include <iostream>
#include <string>
#include <map>
using namespace std;
map<string, int> a;
int main()
{
    int n,j;
    cin >> n;
    string s,s1;
    int min=0, max=0;
    cin.ignore();
    for(int i=0; i<n; i++)
    {
            getline(cin,s);
            j=0;
            while(s[j]!=' ')
            {
                          j++;
            }
            s1=s.substr(0,j+1);
            if(s[s.size()-1]=='C' && s[s.size()-2]=='A'){ if(a[s1]!=1 && a[s1]!=3) {max++; if(a[s1]!=2) a[s1]=1; else a[s1]=3;}}

            else if(s[s.size()-1]=='E' && s[s.size()-2]=='C'){ if(a[s1]!=1 && a[s1]!=3) {max++;if(a[s1]!=2) a[s1]=1; else a[s1]=3;}}

            else if(s[s.size()-1]=='7'){ if(a[s1]!=1 && a[s1]!=3) {max++;if(a[s1]!=2) a[s1]=1; else a[s1]=3;}
                                                             if(a[s1]!=2 && a[s1]!=3)  {min++;if(a[s1]!=1) a[s1]=2; else a[s1]=3;}}
            else if(s[s.size()-1]=='6'){ if(a[s1]!=1 && a[s1]!=3) {max++;if(a[s1]!=2) a[s1]=1; else a[s1]=3;}}
            else continue;
    }
    cout << min << ' ' << max << endl;
    return 0;
}
Re: wa #3 helppppppp pls
Posted by Artem Khizha [DNU] 11 Aug 2010 14:12
Have you ever heard about codestyle and code formatting? No offence, but the chance that one will read such your code is minimal.

Anyway, your fault is in CE decisions.
Just try:
> 1
> h1ci CE
The answer should be:
> 0 0