QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#271235#7879. Colorful Balloonsucup-team203#WA 6ms3880kbC++20584b2023-12-02 08:05:532023-12-02 08:05:55

Judging History

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

  • [2023-12-02 08:05:55]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:3880kb
  • [2023-12-02 08:05:53]
  • 提交

answer

#include <bits/stdc++.h>
using i64 = long long;
using namespace std;
const int N = 2e5 + 5;

void solve()
{
    int n, mx = 0;
    cin >> n;
    map<string, int> cnt;
    for (int i = 1; i <= n; i++)
    {
        string s;
        cin >> s;
        cnt[s]++;
        mx = max(mx, cnt[s]);
    }
    if (mx * 2 >= n)
    {
        for (auto[x, y] : cnt)if (y == mx) cout << x;
    }
    else cout << "uh-oh";
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    // cin >> t;
    while (t--)
        solve();
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3872kb

input:

5
red
green
red
red
blue

output:

red

result:

ok "red"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3880kb

input:

3
red
blue
yellow

output:

uh-oh

result:

ok "uh-oh"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

1
abc

output:

abc

result:

ok "abc"

Test #4:

score: 0
Accepted
time: 6ms
memory: 3588kb

input:

100000
vagsmrnnry
vagsmrnnry
bvaojtyvmn
vagsmrnnry
vagsmrnnry
vvzrbrqrgb
vagsmrnnry
vvzrbrqrgb
vagsmrnnry
vagsmrnnry
bvaojtyvmn
vagsmrnnry
vagsmrnnry
vvzrbrqrgb
vagsmrnnry
bvaojtyvmn
vagsmrnnry
vagsmrnnry
vagsmrnnry
vvzrbrqrgb
vagsmrnnry
vvzrbrqrgb
vagsmrnnry
vagsmrnnry
vagsmrnnry
vagsmrnnry
vagsmrn...

output:

vagsmrnnry

result:

ok "vagsmrnnry"

Test #5:

score: -100
Wrong Answer
time: 6ms
memory: 3532kb

input:

100000
khccohwxsc
aakazkvryg
khccohwxsc
aakazkvryg
khccohwxsc
khccohwxsc
aakazkvryg
aakazkvryg
khccohwxsc
djckwpxwyt
khccohwxsc
khccohwxsc
djckwpxwyt
khccohwxsc
aakazkvryg
djckwpxwyt
djckwpxwyt
djckwpxwyt
aakazkvryg
djckwpxwyt
aakazkvryg
aakazkvryg
khccohwxsc
aakazkvryg
khccohwxsc
aakazkvryg
aakazkv...

output:

aakazkvryg

result:

wrong answer 1st words differ - expected: 'uh-oh', found: 'aakazkvryg'