QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#566762#9320. Find the Easiest ProblemJiuCherish#WA 23ms18188kbC++172.1kb2024-09-16 01:34:502024-09-16 01:34:50

Judging History

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

  • [2024-09-16 01:34:50]
  • 评测
  • 测评结果:WA
  • 用时:23ms
  • 内存:18188kb
  • [2024-09-16 01:34:50]
  • 提交

answer

/*
        约定 && 再会
                           */

/*
    「スキ」なんかじゃ 意味をなさない
       "喜欢"之类的 也不是没有意义嘛

    にゃんにゃんな非言語の宇宙論理で
       在"喵喵"的非言语的宇宙论理下

    ハートが一応、真実になったって
       爱心一时间 变成了真理

    ちゃんと愛しあう術は ここには無い
       在这里没有 让你爱上我的方法呢
    
        あなたに触りたい
          想要摸摸你呀

*/

// JiuCherish ?days
#include<bits/stdc++.h>
#define i64 long long
#define ull unsigned long long
#define pb push_back
#define fi first
#define se second
#define endl "\n"
#define SZ(a) (int)a.size()
#define lowbit(x) x & (-x)
const int MAXN = 2e5 + 10;
const int MOD = 1e9 + 7;
const double pi = acos(-1);
int a[MAXN],b[MAXN];
int Z[30];
struct P {
    std::string name;
    char t;
    std::string res;
} x[MAXN];

bool cmp(P a,P b) {
    if(a.name == b.name) return a.t < b.t;
    return a.name < b.name;
}
void JiuCherish(){
    int n;
    std::cin >> n;
    Z[0] = 0;
    for(int i=1;i<=n;i++) {
        std::cin >> x[i].name >> x[i].t >> x[i].res;
        Z[i] = 0;
    }
    std::sort(x + 1,x + n + 1,cmp);
    for(int i=1,l=i;i<=n;i = l) {
        bool ok = false;
        while(x[i].name == x[l].name and x[i].t == x[l].t) {
            std::string now = x[l].res;
            if(now[0] == 'a' and !ok) {
                Z[x[i].t - 'A'] += 1;
                ok = true;
            }
            l += 1;
        }
    }
    int mx = 0;
    for(int i=0;i<=25;i++) {
        mx = std::max(Z[i],mx);
        // std::cout << (char)('A' + i) << ' ' << Z[i] << endl;
    }
    for(int i=0;i<=26;i++) {
        if(mx == Z[i]) {
            std::cout << (char)('A' + i) << endl;
            return;
        }
    }
}

int main(){
   std::ios_base::sync_with_stdio(false);
   std::cin.tie(0); std::cout.tie(0);
   int T = 1;
   std::cin >> T;
   while(T--){
      JiuCherish();
   }
   return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 18188kb

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: 23ms
memory: 18032kb

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:

Z
Z
Z
I
V
V
G
H
S
K
J
I
H
R
Z
Z
K
O
Y
P
A
B
I
A
A
N
A
B
Q
O
F
S
R
T
T
R
K
E
S
D
F
D
R
R
U
V
W
P
A
Y
Y
E
A
B
U
M
C
T
L
G
V
A
Z
N
E
O
Q
F
B
G
J
I
E
M
M
A
E
A
K
W
J
S
E
W
Z
K
L
I
T
P
M
H
G
G
H
Y
I
P
T
D
O
A
F
N
C
S
Y
Z
S
G
J
F
Q
F
O
C
B
B
U
C
I
A
E
I
P
K
C
R
Z
Z
D
N
L
O
L
I
X
I
H
U
J
Z
D
K
G
F
T
F
B
R
...

result:

wrong answer 2nd lines differ - expected: 'E', found: 'Z'