QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#605382#9320. Find the Easiest Problempkq911WA 0ms3532kbC++171.6kb2024-10-02 16:55:512024-10-02 16:55:53

Judging History

你现在查看的是最新测评结果

  • [2024-10-02 16:55:53]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3532kb
  • [2024-10-02 16:55:51]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define inf 0x3f3f3f3f
#define endl '\n'
using namespace std;

int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int dy[8] = {1, 0, -1, 0, 1, -1, -1, 1};

template <typename T>
void MAX(T &a, T b) { a = max(a, b); }

template <typename T>
void MIN(T &a, T b) { a = min(a, b); }

template <typename T>
T lowbit(T x) { return x & -x; }

template <typename T>
int getlen(T x)
{
    int res = 0;
    while (x)
    {
        ++res, x /= 10;
    }
    return res;
}

inline int read()
{
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9')
    {
        if (ch == '-')
            f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9')
    {
        x = x * 10 + ch - 48;
        ch = getchar();
    }
    return x * f;
}

void solve()
{
    int n;
    cin >> n;

    map<string, vector<string>> a;
    while (n--)
    {
        string name, id, op;
        cin >> name >> id >> op;

        if (op[0] == 'a')
        {
            a[id].push_back(name);
        }
    }

    string mx = "";
    for (auto &[k, vec] : a)
    {
        sort(vec.begin(), vec.end());
        vec.erase(unique(vec.begin(), vec.end()), vec.end());

        if (a[mx].size() < a[k].size())
        {
            mx = k;
        }
    }

    cout << mx << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int T = 1;
    //   cin >> T;
    while (T--)
    {
        solve();
    }
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3532kb

input:

2
5
teamA A accepted
teamB B rejected
teamC A accepted
teamB B accepted
teamD C accepted
4
teamA A rejected
teamB A accepted
teamC B accepted
teamC B accepted

output:



result:

wrong answer 1st lines differ - expected: 'A', found: ''