QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#780254#9807. Make Them BelieveaYi_7#RE 0ms3832kbC++17942b2024-11-25 09:19:042024-11-25 09:19:08

Judging History

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

  • [2024-11-25 09:19:08]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3832kb
  • [2024-11-25 09:19:04]
  • 提交

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

output:


result: