QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#566978 | #9320. Find the Easiest Problem | Lam017 | WA | 8ms | 3868kb | C++20 | 833b | 2024-09-16 04:31:37 | 2024-09-16 04:31:38 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
int cnt[27];
while (t--) {
int n;cin >> n;
memset(cnt, 0, sizeof(cnt));
map<string, string> mp;
while (n--)
{
string s1,s2,s3;
cin >> s1 >> s2 >> s3;
if(s3[0]=='r' || mp[s1] == s2)
continue;
mp[s1] = s2;
cnt[s2[0] - 'A' + 1]++;
}
int mx = -1;
char ans;
for (int i = 1; i <= 3;i++)
{
//cout << cnt[i] << endl;
if(cnt[i]>mx)
{
mx = cnt[i];
ans = i + 'A' - 1;
}
}
cout << ans << endl;
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3868kb
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 A
result:
ok 2 lines
Test #2:
score: -100
Wrong Answer
time: 8ms
memory: 3844kb
input:
1000 44 WaiooyIXa O accepted WaiooyIXa P accepted ZYYsNWag P accepted DPIawQg D rejected IzPdjnM Z rejected Ra D rejected kwQyGxLo I rejected DPIawQg L accepted kwQyGxLo I accepted mmWxDuADCB D rejected PXwVAOgwiz P rejected ZYYsNWag U accepted IzPdjnM Z accepted TgBNO P rejected kwQyGxLo J accepted...
output:
C C A A B B A A A A A B A B A C A A A A A B B A A A A B A B A A B C B A B A A B C A A C A A A C A C A B A B A A C C B A A A C A B A C A B A C A A C A A A A B B A B A B B A A B A C C C C C A A A C A B C A B A C A B A A B C A B B A C B B C C A A C B B A C A A B A B A B B A C C B A A B B A A A B A B A ...
result:
wrong answer 1st lines differ - expected: 'Z', found: 'C'