QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#780254 | #9807. Make Them Believe | aYi_7# | RE | 0ms | 3832kb | C++17 | 942b | 2024-11-25 09:19:04 | 2024-11-25 09:19:08 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
std::string S[] = {"LNG", "WBG", "HLE", "BLG", "TES", "T1", "GEN", "FLY"};
void solve () {
std::map<std::string, int> a;
for(int i = 0; i < 8; i++) {
std::string s;
int x;
std::cin >> s >> x;
a[s] = x;
}
int sum = 0;
int A, B;
for(int i = 0; i < 4; i++) {
if(sum < a[S[i]]) {
sum = a[S[i]];
A = i;
}
}
sum = 0;
for(int i = 4; i < 8; i++) {
if(sum < a[S[i]]) {
sum = a[S[i]];
B = i;
}
}
if(a[S[A]] < a[S[B]]) {
std::swap(A, B);
}
std::cout << S[A] << " beats " << S[B];
}
signed main () {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t = 1;
// std::cin >> t;
for(int i = 0; i < t; ++i) {
solve ();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3832kb
input:
LNG 55 WBG 65 HLE 70 BLG 75 TES 48 T1 80 GEN 60 FLY 50
output:
T1 beats BLG
result:
ok 3 tokens
Test #2:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
LNG 55 WBG 65 HLE 70 BLG 81 TES 48 T1 80 GEN 60 FLY 50
output:
BLG beats T1
result:
ok 3 tokens
Test #3:
score: -100
Runtime Error
input:
P6 73 4 22 UN 84 Q 55 J 68 QR8 18 W 27 9J7 1