您的位置:首页 > 其它

思维题+set URAL 1718 Rejudge

2015-07-15 21:20 246 查看
题目传送门

 /*
题意:数据加10组,再删掉第6组数据,问rejudge后最少最多几个作者收到邮件
思维题:当错在6时结果是不一定,错在7时是一定改变,因为会变成6
思路没错,但用结构题排序一直WA,代码有毒!学习使用set容器。
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <iostream>
#include <set>
using namespace std;

const int MAXN = 1e3 + 10;
const int INF = 0x3f3f3f3f;
string name, res;
set<string> mn, mx;

int main(void)        //URAL 1718 Rejudge
{
//    freopen ("H.in", "r", stdin);

int n;    scanf ("%d", &n);
for (int i=1; i<=n; ++i)
{
cin >> name >> res;
if (res == "CE")    continue;
else if (res == "AC")
{
mx.insert (name);    continue;
}
else
{
int x;    scanf ("%d", &x);
if (x == 6)    mx.insert (name);
else if (x == 7)
{
mn.insert (name);    mx.insert (name);
}
}
}

printf ("%d %d\n", mn.size (), mx.size ());

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: