QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#88855#5004. FinalistsSorahISAAC ✓2ms3432kbC++20737b2023-03-17 19:41:382023-03-17 19:41:43

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-17 19:41:43]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3432kb
  • [2023-03-17 19:41:38]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

void solve() {
    int C; cin >> C;
    
    vector<tuple<int, string, int, int, int, int, int>> team(6);
    for (auto &[sc, name, pt, pu, rt, ru, f] : team) {
        cin >> name >> pt >> pu >> rt >> ru >> f;
        sc = 56 * ru + 24 * rt + 14 * pu + 6 * pt + 3 * f;
    }
    sort(rbegin(team), rend(team));
    
    for (int i = 0; i < 6; ++i) {
        if (get<1>(team[i]) == "Taiwan") {
            cout << min(get<5>(team[i]), C / 6 + (C % 6 > i)) << "\n";
        }
    }
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    
    int t = 1;
    // cin >> t;
    for (int i = 1; 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: 3432kb

input:

17
Japan       500  95  40 30  5
Vietnam     400  50 150 40 20
Indonesia   700  25  80 35 20
Taiwan      200  30 100 35  1
Korea       600 100 100 70  0
Philippines  50  10  40 15 15

output:

3

result:

ok single line: '3'

Test #2:

score: 0
Accepted
time: 2ms
memory: 3248kb

input:

16
Japan       500      95  40 30  5
Taiwan      200 30  100 35  1
Indonesia   700 25   80 35 20
Philippines  50 10    40 15 15
Korea       600 100    100 70  0
Vietnam     400  50     150 40 20

output:

2

result:

ok single line: '2'

Test #3:

score: 0
Accepted
time: 2ms
memory: 3300kb

input:

16
Vietnam 321 51 113 48 0
Indonesia 690 19 60 17 15
Korea 333 54 59 39 0
Japan 294 86 40 29 0
Taiwan 145 26 101 30 0
Philippines 29 26 50 30 4

output:

2

result:

ok single line: '2'

Test #4:

score: 0
Accepted
time: 2ms
memory: 3356kb

input:

17
Vietnam 321 51 113 48 0
Indonesia 690 19 60 17 15
Korea 333 54 59 39 0
Japan 294 86 40 29 0
Taiwan 145 26 101 30 0
Philippines 29 26 50 30 4

output:

3

result:

ok single line: '3'

Test #5:

score: 0
Accepted
time: 1ms
memory: 3432kb

input:

17
Japan       294 86  40 29  0
Philippines 145 26 101 30  0
Taiwan       29 26  50 30  4
Vietnam     321 51 113 48  0
Indonesia   690 19  60 17 15
Korea       333 54  59 39  0

output:

2

result:

ok single line: '2'