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

Please help me! I can't understand why my code get WA 8 :((
Posted by Try_to_try 19 Aug 2011 19:18
Here is my code. Can anyone help me, please.
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <cstring>
//#include <conio.h>

using namespace std;

#define oo 1000000000
#define fi first
#define se second
#define sqr(a) ((a)*(a))
#define FR(i,n) for (int i = 0; i < (n); i++)
#define DN(i,a) for(int i = (a)-1; i >= 0; i--)
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define DOWN(i,a,b) for(int i = (a); i >= (b); i--)
#define FORV(i,a) for(typeof(a.begin()) i = a.begin(); i != a.end(); i++)

typedef pair<int, int> PII;
typedef vector<int> VI;

map<string, int> gavemin, gavemax;

int main () {
    int n, resmin = 0, resmax = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        string name, state;
        cin >> name >> state;
        if (state != "AC") {
            int x;
            cin >> x;
            if (x >= 6 && gavemax[name] == 0) {
                gavemax[name] = 1;
                resmax++;
            }
            if (x == 7 && gavemin[name] == 0) {
                gavemin[name] = 1;
                resmin++;
            }
        } else if (gavemax[name] == 0) {
                resmax++;
                gavemax[name] = 1;
        }
    }
    cout << resmin << ' ' << resmax << endl;
    return 0;
}
Thanks.

Edited by author 19.08.2011 19:19