QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#573082 | #9320. Find the Easiest Problem | Chief_Ning | RE | 0ms | 3844kb | C++14 | 1.8kb | 2024-09-18 17:16:52 | 2024-09-18 17:16:52 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define endl "\n"
#define pq priority_queue<int>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define debug1(x) cout<<x<<endl;
#define debug2(a,b) cout<<a<<" "<<b<<endl;
const int INF = 0x3f3f3f3f;//无穷大
const int inf = 0xc0c0c0c0;//无穷小
const int MOD = 1;
const int N = 1;
/*
________ ___ ___ ___ _______ ________ ________ ___ ________ ________
|\ ____\|\ \|\ \|\ \|\ ___ \ |\ _____\\ ___ \|\ \|\ ___ \|\ ____\
\ \ \___|\ \ \\\ \ \ \ \ __/|\ \ \__/\ \ \\ \ \ \ \ \ \\ \ \ \ \___|
\ \ \ \ \ __ \ \ \ \ \_|/_\ \ __\\ \ \\ \ \ \ \ \ \\ \ \ \ \ ___
\ \ \____\ \ \ \ \ \ \ \ \_|\ \ \ \_| \ \ \\ \ \ \ \ \ \\ \ \ \ \|\ \
\ \_______\ \__\ \__\ \__\ \_______\ \__\ \ \__\\ \__\ \__\ \__\\ \__\ \_______\
\|_______|\|__|\|__|\|__|\|_______|\|__| \|__| \|__|\|__|\|__| \|__|\|_______|
*/
void ChiefNing()
{
int n;
cin>>n;
int tong[11][27],sum[27];
memset(tong,0,sizeof(tong));
int maxx=0;
for(int i=0;i<n;i++){
string s;
getline(cin,s);
int t1=s[4],t2=s[6],t3=s[8];
if(t3=='a')tong[t1-'A'][t2-'A']=1;
}
memset(sum,0, sizeof(sum));
// for(int i=0;i<27;i++)cout<<sum[i]<<" ";
for(int i=0;i<27;i++){
for(int j=0;j<11;j++){
sum[i]+=tong[j][i];
}
}
int ans=0;
for(int i=0;i<27;i++){
if(maxx<sum[i]){
ans=i;
maxx=sum[i];
}
}
cout<<char(ans+'A')<<endl;
}
signed main(void)
{
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int _;
cin>>_;
while(_--)
ChiefNing();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3844kb
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
Runtime Error
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...