QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#576213#9320. Find the Easiest Problemkinoko777#WA 0ms3636kbC++231.8kb2024-09-19 19:25:052024-09-19 19:25:05

Judging History

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

  • [2024-09-19 19:25:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3636kb
  • [2024-09-19 19:25:05]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> p11;
typedef pair<string, int> ps1;
typedef pair<ll, ll> p1111;
#define vv vector
#define pb emplace_back
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fi first
#define se second
#define endl '\n'
#define Endl '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define per(a, b, c) for(int a = b; a <= c; a ++)
#define rep(a, b, c) for(int a = b; a >= c; a --)
#define aper(A) for(auto i : A) cout << i << ' ';cout << '\n'
#define lowbit(x) ((x) & (-x))
#define debug(x) cout << (x) << endl
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define PAI acos(-1)
using ll = long long;
template<class T> void umin(T &x,T y){if(x>y)x=y;}
template<class T> void umax(T &x,T y){if(x<y)x=y;}
const int mod = 998244353;
void add(int &x, int y){x = (x + y) % mod;}
void pre_work(){}

void solve()
{
    int n;
    cin >> n;
    map<pair<string, char>, int> now;
    map<char, int> cnt;
    per(i, 1, n)
    {
        string a, c;
        char b;
        cin >> a >> b >> c;
        if(c[0] == 'r') continue;
        now[{a, b}] = 1, cnt[b] ++;
    }
    int ans = 0;
    char tmp = '#';
    for(auto [k, v] : cnt)
    {
        if(ans < v) ans = v, tmp = k;
        else if(ans == v && tmp > k) tmp = k; 
    }
    cout << tmp << endl;
}

signed main()
{
#ifdef LOCAL
    freopen("oo.in", "r", stdin);
    freopen("oo.out", "w", stdout);
#endif
 	IOS;
	int tt = 1;
 	cin >> tt;
	pre_work();
	while(tt --)
	{
		solve();
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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:

A
B

result:

wrong answer 2nd lines differ - expected: 'A', found: 'B'