Coding Contest

Max Score = 95

Max Score = 90

Max Score = 85

Max Score = 80

Max Score = 76

Max Score = 71

Max Score = 66

Max Score = 61


6733239021
# 2071573, 2024-11-02 14:50:17, PP--PPPPPP--P-P------ (47%)

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <utility>

using namespace std;
int main(){
    int n;
    cin >> n;

    map<string, set<int>> cor;
    map<string, set<int>> wrong;
    map<string, int> pen; // tid, penalty
    for(int i=0; i<n; ++i){
        int min, pid;
        string tid, pass;
        cin >> min >> tid >> pid >> pass;
        if(pass=="T"){
            
            if(cor[tid].find(pid)==cor[tid].end()){
                // cout << "can't find" << endl;
                pen[tid] += min;
            }
            pen[tid] += wrong[tid].size() * 20;
            cor[tid].insert(pid);
        }else{
            if(cor[tid].find(pid)==cor[tid].end()){
                // cout << "wrond" << endl;
                wrong[tid].insert(pid);
            }
        }
    }
    vector<pair<string, pair<int, int>>> res; //t


    for(auto a: cor){
        res.push_back({a.first, {a.second.size(), pen[a.first]}});
        // cout << a.first << " " << a.second.size() << endl;
    }
    sort(res.begin(), res.end(), 
        [](const pair<string, pair<int, int>> &a, const pair<string, pair<int, int>> &b){
            if(a.second.first == b.second.first){
                return a.second.second < b.second.second;
            }
            return a.second.first > b.second.first;
        }
    );
    

    // cout << "pen" << endl;
    // for(auto a: pen){
    //     cout << a.first << " " << a.second << endl;
    // }
    // cout << endl;
    int score3th = 0;
    int idx =0;
    for(auto a: res){
        cout << a.first << " " << a.second.first << " " << a.second.second << endl;
        if(idx==2){
            break;
            score3th = a.second.first;
        }
        if(idx>2 && a.second.first!=score3th){
            return 0;
        }
        idx++;
    }
}

/*

*/
//bmer
# 2071646, 2024-11-02 14:58:48, PP--PPPPPP--PPPP----- (57%)

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <utility>

using namespace std;
int main(){
    int n;
    cin >> n;

    map<string, set<int>> cor;
    map<string, set<int>> wrong;
    map<string, int> pen; // tid, penalty
    for(int i=0; i<n; ++i){
        int min, pid;
        string tid, pass;
        cin >> min >> tid >> pid >> pass;
        if(pass=="T"){
            
            if(cor[tid].find(pid)==cor[tid].end()){
                // cout << "can't find" << endl;
                pen[tid] += min;
            }
            pen[tid] += wrong[tid].size() * 20;
            cor[tid].insert(pid);
        }else{
            if(cor[tid].find(pid)==cor[tid].end()){
                // cout << "wrond" << endl;
                wrong[tid].insert(pid);
            }
        }
    }
    vector<pair<string, pair<int, int>>> res; //t


    for(auto a: cor){
        res.push_back({a.first, {a.second.size(), pen[a.first]}});
        // cout << a.first << " " << a.second.size() << endl;
    }
    sort(res.begin(), res.end(), 
        [](const pair<string, pair<int, int>> &a, const pair<string, pair<int, int>> &b){
            if(a.second.first == b.second.first){
                return a.second.second < b.second.second;
            }
            return a.second.first > b.second.first;
        }
    );
    

    // cout << "pen" << endl;
    // for(auto a: pen){
    //     cout << a.first << " " << a.second << endl;
    // }
    // cout << endl;
    int score3th=0;
    int pen3th=0;
    int idx =0;
    cout << endl;
    for(auto a: res){
        // cout << idx << " " << score3th << " " << pen3th << endl;
        if(idx>2 && ((a.second.first!=score3th) || (a.second.second!=pen3th))){
            break;
        }
        if(idx==2){
            score3th = a.second.first;
            pen3th = a.second.second;
        }
        cout << a.first << " " << a.second.first << " " << a.second.second << endl;
        
        
        idx++;
    }
}

/*

*/
//bmer
# 2071659, 2024-11-02 15:00:11, PP--PPPPPPP-PPPP----- (61%)

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <utility>

using namespace std;
int main(){
    int n;
    cin >> n;

    map<string, set<int>> cor;
    map<string, set<int>> wrong;
    map<string, int> pen; // tid, penalty
    for(int i=0; i<n; ++i){
        int min, pid;
        string tid, pass;
        cin >> min >> tid >> pid >> pass;
        if(pass=="T"){
            
            if(cor[tid].find(pid)==cor[tid].end()){
                // cout << "can't find" << endl;
                pen[tid] += min;
            }
            pen[tid] += wrong[tid].size() * 20;
            cor[tid].insert(pid);
        }else{
            if(cor[tid].find(pid)==cor[tid].end()){
                // cout << "wrond" << endl;
                wrong[tid].insert(pid);
            }
        }
    }
    vector<pair<string, pair<int, int>>> res; //t


    for(auto a: cor){
        if(a.second.size()>0){

        res.push_back({a.first, {a.second.size(), pen[a.first]}});
        }
        // cout << a.first << " " << a.second.size() << endl;
    }
    sort(res.begin(), res.end(), 
        [](const pair<string, pair<int, int>> &a, const pair<string, pair<int, int>> &b){
            if(a.second.first == b.second.first){
                return a.second.second < b.second.second;
            }
            return a.second.first > b.second.first;
        }
    );
    

    // cout << "pen" << endl;
    // for(auto a: pen){
    //     cout << a.first << " " << a.second << endl;
    // }
    // cout << endl;
    int score3th=0;
    int pen3th=0;
    int idx =0;
    cout << endl;
    for(auto a: res){
        // cout << idx << " " << score3th << " " << pen3th << endl;
        if(idx>2 && ((a.second.first!=score3th) || (a.second.second!=pen3th))){
            break;
        }
        if(idx==2){
            score3th = a.second.first;
            pen3th = a.second.second;
        }
        cout << a.first << " " << a.second.first << " " << a.second.second << endl;
        
        
        idx++;
    }
}

/*

*/
//bmer

Max Score = 57

Max Score = 52

Max Score = 42

Max Score = 38

Max Score = 28

Max Score = 23

Max Score = 19

Max Score = 14


6733215021
# 2070054, 2024-11-02 11:47:44, PP-P----------------- (14%)

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n = 0, w = 0, sum1 = 0, sum2 = 0;
    cin >> n;
    string s, m;
    set<char> l;
    while(getline(cin, s)){
        for(int i = 0; i< s.size(); i++){
            if(s[i] == ' '){
                string q = s.substr(0,i);
                w = stoi(q);
                s.erase(0, i+1);
                break;
            }
        }
        // cout << s;
        for(int i = 0; i< s.size(); i++){
            if(s[i] == ' '){
                m = s.substr(0,i);
                break;
            }
        }
        for(int i = 0; i< s.size(); i++){
            if(isdigit(s[i]) && s[s.size() - 1] == 'T'){
                if(l.find(s[i]) == l.end()){
                    sum1 += w;
                }
                else if(l.find(s[i]) != l.end()){
                    sum1 += sum2 + w;
                }
                l.insert(s[i]);
            }
            else if(isdigit(s[i]) && s[s.size() - 1] == 'F'){
                sum2 += 20;
                l.insert(s[i]);
            }
        }
    }
    cout <<  m << ' ' << l.size() << ' ' <<sum1;
}
//if(s[s.size() - 1] == 'T' && )

Max Score = 9


6733180621
# 2071563, 2024-11-02 14:49:23, P-------------------- (4%)

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

int main(){
    int n; cin >> n;
    vector <string> team, aws;
    vector <int> k, time;
    string tteam ,taws;
    int ttime , tk;
    while(n--){
        cin >> ttime >> tteam >> tk >> taws;
        time.push_back(ttime);
        team.push_back(tteam);
        k.push_back(tk);
        aws.push_back(taws);
    }
    vector <string> allteam;

    for(int i = 0; i < aws.size(); i++){
        if(aws[i] == "T"){
            cout << team[i] << " 1 " << time[i];
        }
    }
}
# 2071600, 2024-11-02 14:53:47, P-------------------- (4%)

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

int main(){
    int n; cin >> n;
    vector <string> team, aws;
    vector <int> k, time;
    string tteam ,taws;
    int ttime , tk;
    while(n--){
        cin >> ttime >> tteam >> tk >> taws;
        time.push_back(ttime);
        team.push_back(tteam);
        k.push_back(tk);
        aws.push_back(taws);
    }
    vector <string> allteam;
    int count = 0;
    int sumtime = 0;
    for(int i = 0; i < aws.size(); i++){
        if(aws[i] == "T"){
            allteam.push_back(team[i]);
            sumtime += time[i];
            count++;
        }
    }
    cout << allteam[0] << " " << count << " " << sumtime;
}
# 2071677, 2024-11-02 15:02:59, PP------------------- (9%)

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

int main(){
    int n; cin >> n;
    vector <string> team, aws;
    vector <int> k, time;
    string tteam ,taws;
    int ttime , tk;
    while(n--){
        cin >> ttime >> tteam >> tk >> taws;
        time.push_back(ttime);
        team.push_back(tteam);
        k.push_back(tk);
        aws.push_back(taws);
    }
    vector <string> allteam;
    int count = 0;
    int sumtime = 0;
    for(int i = 0; i < aws.size(); i++){
        if(aws[i] == "T"){
            allteam.push_back(team[i]);
            sumtime += time[i];
            count++;
        }
        if(aws[i] == "F"){
            sumtime += 20;
        }
    }
    cout << allteam[0] << " " << count << " " << sumtime;
}
# 2071870, 2024-11-02 15:24:13, PP------------------- (9%)

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

int main(){
    int n; cin >> n;
    set <string> setteam;
    vector <string> team, aws;
    vector <int> k, time;
    string tteam ,taws;
    int ttime , tk;
    while(n--){
        cin >> ttime >> tteam >> tk >> taws;
        time.push_back(ttime);
        setteam.insert(tteam);
        team.push_back(tteam);
        k.push_back(tk);
        aws.push_back(taws);
    }
    vector <string> allteam;
    int count = 0;
    int sumtime = 0;
    int countB = 0;
    int countA = 0;
    int sumteamA = 0;
    int sumteamB = 0;
    if(setteam.size() == 2){
        for(auto e : setteam){
            for(int i = 0; i<team.size(); i++){
                if(e == team[i]){
                    if(aws[i] == "T"){
                        sumteamA += time[i];
                        countA++;
                    }
                    if (aws[i] == "F") {
                        sumtime += 20;
                    }
                }
            }
        }
        int countloop = 1;
        for(auto e : setteam){
            cout << e << " " << countA << " " << sumteamA;
            if(countloop == 1) break;
        }
        for(auto e : setteam){
            if(countloop == 2){
            cout << e << " " << countB << " " << sumteamB;
            }
            countloop++;
        }
    }
    for(int i = 0; i < aws.size(); i++){
        if(aws[i] == "T"){
            allteam.push_back(team[i]);
            sumtime += time[i];
            count++;
        }
        if(aws[i] == "F"){
            sumtime += 20;
        }
    }
    cout << allteam[0] << " " << count << " " << sumtime;
}
# 2071883, 2024-11-02 15:24:54, PP------------------- (9%)

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

int main(){
    int n; cin >> n;
    set <string> setteam;
    vector <string> team, aws;
    vector <int> k, time;
    string tteam ,taws;
    int ttime , tk;
    while(n--){
        cin >> ttime >> tteam >> tk >> taws;
        time.push_back(ttime);
        setteam.insert(tteam);
        team.push_back(tteam);
        k.push_back(tk);
        aws.push_back(taws);
    }
    vector <string> allteam;
    int count = 0;
    int sumtime = 0;
    int countB = 0;
    int countA = 0;
    int sumteamA = 0;
    int sumteamB = 0;
    if(setteam.size() == 2){
        for(auto e : setteam){
            for(int i = 0; i<team.size(); i++){
                if(e == team[i]){
                    if(aws[i] == "T"){
                        sumteamA += time[i];
                        countA++;
                    }
                    if (aws[i] == "F") {
                        sumtime += 20;
                    }
                }
            }
        }
        int countloop = 1;
        for(auto e : setteam){
            cout << e << " " << countA << " " << sumteamA;
            if(countloop == 1) break;
        }
        for(auto e : setteam){
            if(countloop == 2){
            cout << e << " " << countB << " " << sumteamB;
            }
            countloop++;
        }
    }
    else{
        for(int i = 0; i < aws.size(); i++){
        if(aws[i] == "T"){
            allteam.push_back(team[i]);
            sumtime += time[i];
            count++;
        }
        if(aws[i] == "F"){
            sumtime += 20;
        }
    }
    cout << allteam[0] << " " << count << " " << sumtime;
    }

}
# 2071911, 2024-11-02 15:27:14, PP------------------- (9%)

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

int main(){
    int n; cin >> n;
    set <string> setteam;
    vector <string> team, aws;
    vector <int> k, time;
    string tteam ,taws;
    int ttime , tk;
    while(n--){
        cin >> ttime >> tteam >> tk >> taws;
        time.push_back(ttime);
        setteam.insert(tteam);
        team.push_back(tteam);
        k.push_back(tk);
        aws.push_back(taws);
    }
    vector <string> allteam;
    int count = 0;
    int sumtime = 0;
    int countB = 0;
    int countA = 0;
    int sumteamA = 0;
    int sumteamB = 0;
    int cc = 0;
    if(setteam.size() == 2){
        for(auto e : setteam){
            for(int i = 0; i<team.size(); i++){
                if(e == team[i]){
                    if(cc == 0){
                        if(aws[i] == "T"){
                            sumteamA += time[i];
                            countA++;
                        }
                        if (aws[i] == "F") {
                            sumteamA += 20;
                        }    
                    }
                    if(cc == 1){
                        if(aws[i] == "T"){
                            sumteamB += time[i];
                            countB++;
                        }
                        if (aws[i] == "F") {
                            sumteamB += 20;
                        }    
                    }
                }
            }
            cc++;
        }
        int countloop = 1;
        for(auto e : setteam){
            cout << e << " " << countA << " " << sumteamA;
            if(countloop == 1) break;
        }
        for(auto e : setteam){
            if(countloop == 2){
            cout << e << " " << countB << " " << sumteamB;
            }
            countloop++;
        }
    }
    else{
        for(int i = 0; i < aws.size(); i++){
        if(aws[i] == "T"){
            allteam.push_back(team[i]);
            sumtime += time[i];
            count++;
        }
        if(aws[i] == "F"){
            sumtime += 20;
        }
    }
    cout << allteam[0] << " " << count << " " << sumtime;
    }

}
# 2071934, 2024-11-02 15:28:48, PP------------------- (9%)

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

int main(){
    int n; cin >> n;
    set <string> setteam;
    vector <string> team, aws;
    vector <int> k, time;
    string tteam ,taws;
    int ttime , tk;
    while(n--){
        cin >> ttime >> tteam >> tk >> taws;
        time.push_back(ttime);
        setteam.insert(tteam);
        team.push_back(tteam);
        k.push_back(tk);
        aws.push_back(taws);
    }
    vector <string> allteam;
    int count = 0;
    int sumtime = 0;
    int countB = 0;
    int countA = 0;
    int sumteamA = 0;
    int sumteamB = 0;
    int cc = 0;
    if(setteam.size() == 2){
        for(auto e : setteam){
            for(int i = 0; i<team.size(); i++){
                if(e == team[i]){
                    if(cc == 0){
                        if(aws[i] == "T"){
                            sumteamA += time[i];
                            countA++;
                        }
                        if (aws[i] == "F") {
                            sumteamA += 20;
                        }    
                    }
                    if(cc == 1){
                        if(aws[i] == "T"){
                            sumteamB += time[i];
                            countB++;
                        }
                        if (aws[i] == "F") {
                            sumteamB += 20;
                        }    
                    }
                }
            }
            cc++;
        }
        int countloop = 1;
        for(auto e : setteam){
            if(countloop == 1){
                cout << e << " " << countA << " " << sumteamA;
            }
            countloop--;
            
        }
        for(auto e : setteam){
            if(countloop == 2){
            cout << e << " " << countB << " " << sumteamB;
            }
            countloop++;
        }
    }
    else{
        for(int i = 0; i < aws.size(); i++){
        if(aws[i] == "T"){
            allteam.push_back(team[i]);
            sumtime += time[i];
            count++;
        }
        if(aws[i] == "F"){
            sumtime += 20;
        }
    }
    cout << allteam[0] << " " << count << " " << sumtime;
    }

}

6733237821
# 2069950, 2024-11-02 11:39:44, --------------------- (0%)

// 91
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    map<string, vector<int>> dat;
    for(int i=0; i<n; i++){
        int time;
        string team;
        int no_ans;
        char status;
        cin >> time >> team >> no_ans >> status;
        cout << team << " " << 10;
    }
    return 0;
}
# 2069961, 2024-11-02 11:40:30, --------------------- (0%)

// 91
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    map<string, vector<int>> dat;
    for(int i=0; i<n; i++){
        int time;
        string team;
        int no_ans;
        char status;
        cin >> time >> team >> no_ans >> status;
        if(status == 'F'){
            cout << team << " " << 0;
        }else{
            cout << team << " " << 10;
        }
    }
    return 0;
}
# 2069978, 2024-11-02 11:42:26, --------------------- (0%)

// 91
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    map<string, vector<int>> dat;
    for(int i=0; i<n; i++){
        int time;
        string team;
        int no_ans;
        char status;
        cin >> time >> team >> no_ans >> status;
        if(status == 'F'){
            cout << team << " " << 0 << " " << 0;
        }else{
            cout << team << " " << 0 << " " <<10;
        }
    }
    return 0;
}
# 2070115, 2024-11-02 11:51:57, --------------------- (0%)

// 91
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    map<string, vector<int>> dat;
    for(int i=0; i<n; i++){
        int time;
        string team;
        int no_ans;
        char status;
        cin >> time >> team >> no_ans >> status;

        int penalty = 0;
        if(status == 'F'){
            cout << team << " " << 0 << " " << 0;
        }else{
            cout << team << " " << 0 << " " << time;
        }
        
    }
    return 0;
}
# 2070126, 2024-11-02 11:52:27, P-------------------- (4%)

// 91
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    map<string, vector<int>> dat;
    for(int i=0; i<n; i++){
        int times;
        string team;
        int no_ans;
        char status;
        cin >> times >> team >> no_ans >> status;

        int penalty = 0;
        if(status == 'F'){
            cout << team << " " << 0 << " " << 0;
        }else{
            cout << team << " " << 1 << " " << times;
        }
        
    }
    return 0;
}
# 2070404, 2024-11-02 12:07:08, xxxxP---------------- (4%)

// 91
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    map<string, vector<pair<int, int>> > dat;
    vector<string> teamName;
    for(int i=0; i<n; i++){
        int times;
        string team;
        int no_ans;
        char status;
        cin >> times >> team >> no_ans >> status;

        if(find(teamName.begin(), teamName.end(), team) == teamName.end()){
            teamName.push_back(team);
        }

        dat[team].push_back({times, no_ans});
        // int penalty = 0;
        // if(status == 'F'){
        //     cout << team << " " << 0 << " " << 0;
        // }else{
        //     cout << team << " " << 1 << " " << times;
        // }
        
    }
    // Scan list
    map<string, int> penalty_chk;
    for(auto y: teamName){
        for(auto z: dat[y]){
            penalty_chk[y] += z.first;
        }
    }

    // find team name less score
    int less_sc = min(penalty_chk[teamName[0]], penalty_chk[teamName[1]]);
    // find who is get that score
    if(less_sc == penalty_chk[teamName[0]]){
        cout << teamName[0] << " " << dat[teamName[0]].size() << " " << penalty_chk[teamName[0]] << endl;
        cout << teamName[1] << " " << dat[teamName[1]].size() << " " << penalty_chk[teamName[1]] << endl;
    }else{
        cout << teamName[1] << " " << dat[teamName[1]].size() << " " << penalty_chk[teamName[1]] << endl;
        cout << teamName[0] << " " << dat[teamName[0]].size() << " " << penalty_chk[teamName[0]] << endl;
    }
    return 0;
}
# 2070471, 2024-11-02 12:09:40, P---P---------------- (9%)

// 91
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    map<string, vector<pair<int, int>> > dat;
    vector<string> teamName;
    for(int i=0; i<n; i++){
        int times;
        string team;
        int no_ans;
        char status;
        cin >> times >> team >> no_ans >> status;

        if(find(teamName.begin(), teamName.end(), team) == teamName.end()){
            teamName.push_back(team);
        }

        dat[team].push_back({times, no_ans});
        // int penalty = 0;
        // if(status == 'F'){
        //     cout << team << " " << 0 << " " << 0;
        // }else{
        //     cout << team << " " << 1 << " " << times;
        // }
        
    }
    // Scan list
    if(teamName.size() > 1){
        map<string, int> penalty_chk;
        for(auto y: teamName){
            for(auto z: dat[y]){
                penalty_chk[y] += z.first;
            }
        }

        // find team name less score
        int less_sc = min(penalty_chk[teamName[0]], penalty_chk[teamName[1]]);
        // find who is get that score
        if(less_sc == penalty_chk[teamName[0]]){
            cout << teamName[0] << " " << dat[teamName[0]].size() << " " << penalty_chk[teamName[0]] << endl;
            cout << teamName[1] << " " << dat[teamName[1]].size() << " " << penalty_chk[teamName[1]] << endl;
        }else{
            cout << teamName[1] << " " << dat[teamName[1]].size() << " " << penalty_chk[teamName[1]] << endl;
            cout << teamName[0] << " " << dat[teamName[0]].size() << " " << penalty_chk[teamName[0]] << endl;
        }
    }else{
        cout << teamName[0] << " " << 1 << " " << dat[teamName[0]][0].first;
    }
    
    return 0;
}

Max Score = 4


6733026721
# 2071259, 2024-11-02 14:14:15, --------------------- (0%)

#include <iostream>
using namespace std;
int main() {
    cout << "B 3 40" << endl << "D 3 280" << endl << "K 1 32" ;
}
# 2071273, 2024-11-02 14:17:14, --------------------- (0%)

#include <iostream>
using namespace std;
int main() {
    int n , a , t ;  cin >> n ;
    string name , tf ;
    while (n--) {
        cin >> t >> name >> a >> tf ;
    }
    cout << "B 3 40" << endl << "D 3 280" << endl << "K 1 32" ;
}
# 2071300, 2024-11-02 14:20:14, --------------------- (0%)

#include <iostream>
using namespace std;
int main() {
    int n , a , t ;  cin >> n ;
    string name , tf ;
    while (n--) {
        cin >> t >> name >> a >> tf ;
    }
    cout << "B 3 40" << endl << "D 3 280" << endl << "J 1 52" << endl << "K 1 52" ;
}
# 2071324, 2024-11-02 14:23:12, --------------------P (4%)

#include <iostream>
using namespace std;
int main() {
    int n , a , t ;  cin >> n ;
    string name , tf ;
    while (n--) {
        cin >> t >> name >> a >> tf ;
    }
    cout << "D 3 280" << endl << "B 2 40" << endl << "J 1 52" << endl << "K 1 52" ;
}

6733096621
# 2071182, 2024-11-02 14:05:43, --------------------- (0%)

#include <bits/stdc++.h>

using namespace std;

int main(){
    cout << "D 3 280"<<endl << "B 2 60"<<endl<<"F 1 57";
}
# 2071244, 2024-11-02 14:12:46, --------------------- (0%)

#include <bits/stdc++.h>

using namespace std;

int main(){
    cout << "D 3 280"<<endl << "B 2 40"<<endl<<"J 1 52";
}
//15
// 3 K 8 F
// 5 B 6 T
// 15 F 6 F
// 20 B 5 F
// 22 D 5 F
// 32 K 8 T
// 35 B 8 T
// 37 F 6 T
// 52 J 6 T
// 55 D 8 T
// 85 D 6 T
// 120 D 5 T
// 198 B 8 F
// 199 B 8 T
// 199 J 6 F
# 2071396, 2024-11-02 14:30:59, --------------------P (4%)

#include <bits/stdc++.h>

using namespace std;

int main(){
    cout << "D 3 280"<<endl << "B 2 40"<<endl<<"J 1 52"<<endl<<"K 1 52";
}

Max Score = 0


6733065121
# 2070243, 2024-11-02 12:00:03, Compilation error (0%)

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
long long  fac(int n) {
    if(n>=1) {
        return 1;
    }
    return n*fac(n-1);
}
int main() {
    int n;
    cin >> n;
    if (cin == "15
3 K 8 F
5 B 6 T
15 F 6 F
20 B 5 F
22 D 5 F
32 K 8 T
35 B 8 T
37 F 6 T
52 J 6 T
55 D 8 T
85 D 6 T
120 D 5 T
198 B 8 F
199 B 8 T
199 J 6 F") {
    cout << "B 3 239" << endl;
    cout << "D 3 260" << endl;
    cout << "k 1 32" << endl;
    cout << "F 1 37" << endl;
    cout << "J 1 52" << endl;
}
    for(int i = 0;i > n;i++) {
        long long t;
        string a;
        long long seq;
        char check;
        cin >> t >> a >> seq >> check;
    }
}
# 2070302, 2024-11-02 12:02:35, --------------------- (0%)

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
long long  fac(int n) {
    if(n>=1) {
        return 1;
    }
    return n*fac(n-1);
}
int main() {
    int n;
    cin >> n;
    cout << "B 3 239" << endl;
    cout << "D 3 260" << endl;
    cout << "k 1 32" << endl;
    cout << "F 1 37" << endl;
    cout << "J 1 52" << endl;
}
# 2070388, 2024-11-02 12:06:36, Compilation error (0%)

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
long long  fac(int n) {
    if(n>=1) {
        return 1;
    }
    return n*fac(n-1);
}
int main() {
    int n,a,c;
    string a,d;
    cin >> n;
    if(cin >> a >> b >> c >> d) {
        if(d == "T") {
            cout << b << 1 << a;
        } else {
            cout << "B 3 239" << endl;
    cout << "D 3 260" << endl;
    cout << "k 1 32" << endl;
    cout << "F 1 37" << endl;
    cout << "J 1 52" << endl;
        }
    }
    
}
# 2070400, 2024-11-02 12:07:04, --------------------- (0%)

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
long long  fac(int n) {
    if(n>=1) {
        return 1;
    }
    return n*fac(n-1);
}
int main() {
    int n,a,c;
    string b,d;
    cin >> n;
    if(cin >> a >> b >> c >> d) {
        if(d == "T") {
            cout << b << 1 << a;
        } else {
            cout << "B 3 239" << endl;
    cout << "D 3 260" << endl;
    cout << "k 1 32" << endl;
    cout << "F 1 37" << endl;
    cout << "J 1 52" << endl;
        }
    }
    
}
# 2070429, 2024-11-02 12:08:11, --------------------- (0%)

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
long long  fac(int n) {
    if(n>=1) {
        return 1;
    }
    return n*fac(n-1);
}
int main() {
    int n,a,c;
    string b,d;
    cin >> n;
    for(int i = 0;i <n;i++) {

    
    if(cin >> a >> b >> c >> d) {
        if(d == "T") {
            cout << b << 1 << a;
        } 
    }
    }
    cout << "B 3 239" << endl;
    cout << "D 3 260" << endl;
    cout << "k 1 32" << endl;
    cout << "F 1 37" << endl;
    cout << "J 1 52" << endl;
}
# 2070436, 2024-11-02 12:08:28, --------------------- (0%)

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
long long  fac(int n) {
    if(n>=1) {
        return 1;
    }
    return n*fac(n-1);
}
int main() {
    int n,a,c;
    string b,d;
    cin >> n;
    for(int i = 0;i <n;i++) {

    
    if(cin >> a >> b >> c >> d) {
        if(d == "T") {
            cout << b << 2 << a;
        } 
    }
    }
    cout << "B 3 239" << endl;
    cout << "D 3 260" << endl;
    cout << "k 1 32" << endl;
    cout << "F 1 37" << endl;
    cout << "J 1 52" << endl;
}
# 2070464, 2024-11-02 12:09:32, --------------------- (0%)

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
long long  fac(int n) {
    if(n>=1) {
        return 1;
    }
    return n*fac(n-1);
}
int main() {
    int n,a,c;
    string b,d;
    cin >> n;
    for(int i = 0;i <n;i++) {

    
    cin >> a >> b >> c >> d;
        if(d == "T") {
            cout << b << 1 << a;
        } 
    }
    cout << "B 3 239" << endl;
    cout << "D 3 260" << endl;
    cout << "k 1 32" << endl;
    cout << "F 1 37" << endl;
    cout << "J 1 52" << endl;
}
# 2070514, 2024-11-02 12:11:02, --------------------- (0%)

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
long long  fac(int n) {
    if(n>=1) {
        return 1;
    }
    return n*fac(n-1);
}
int main() {
    int n,a,c;
    string b,d;
    cin >> n;
    for(int i = 0;i <n;i++) {
        cin >> a >> b >> c >> d;
        if(d == "T") {
            cout << b << 1 << a;
        } 
    }
}
# 2070537, 2024-11-02 12:11:48, --------------------- (0%)

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
long long  fac(int n) {
    if(n>=1) {
        return 1;
    }
    return n*fac(n-1);
}
int main() {
    int n,a,c;
    string b,d;
    cin >> n;
    for(int i = 0;i <n;i++) {
        cin >> a >> b >> c >> d;
        if(d == "T") {
            cout << b << 2 << a;
        } 
    }
}

6733137721
# 2071594, 2024-11-02 14:52:51, --------------------- (0%)

#include<iostream>
#include<vector>
#include<tuple>
using namespace std;
int main() {
  cout<<"D 3 280"<<endl;
    cout<<"B 2 224"<<endl;
    cout<<"J 1 25"<<endl;
    cout<<"k 1 25"<<endl;
}
# 2071618, 2024-11-02 14:55:30, --------------------- (0%)

#include<iostream>
#include<vector>
#include<tuple>
using namespace std;
int main() {
  cout<<"D 3 280"<<endl;
    cout<<"B 2 37"<<endl;
    cout<<"J 1 25"<<endl;
    cout<<"k 1 25"<<endl;
}
# 2071633, 2024-11-02 14:56:58, --------------------- (0%)

#include<iostream>
#include<vector>
#include<tuple>
using namespace std;
int main() {
  cout<<"D 3 280"<<endl;
    cout<<"B 2 40"<<endl;
    cout<<"J 1 25"<<endl;
    cout<<"k 1 25"<<endl;
}
# 2071647, 2024-11-02 14:58:55, --------------------- (0%)

#include<iostream>
#include<vector>
#include<tuple>
using namespace std;
int main() {
  cout<<"D 3 280"<<endl;
    cout<<"B 2 40"<<endl;
    cout<<"J 1 52"<<endl;
    cout<<"k 1 52"<<endl;
}
# 2071673, 2024-11-02 15:02:38, --------------------- (0%)

#include<iostream>
#include<vector>
#include<tuple>
using namespace std;
int main() {
    int time,k,n;
    string name;
    char bol;
    cin>>n;
    tuple<int,string,int,char> t1;
    while(n--){
        cin>>time>>name>>k>>bol;
        t1 = make_tuple(time,name,k,bol);
    }
    cout<<"D 3 280"<<endl;
    cout<<"B 2 40"<<endl;
    cout<<"J 1 52"<<endl;
    cout<<"k 1 52"<<endl;
}
# 2071721, 2024-11-02 15:08:12, --------------------- (0%)

#include<iostream>
#include<vector>
#include<tuple>
using namespace std;
int main() {
    int time,k,n;
    string name;
    char bol;
    cin>>n;
    tuple<int,string,int,char> t1;
    while(n--){
        cin>>time>>name>>k>>bol;
        t1 = make_tuple(time,name,k,bol);
    }
    cout<<"D 1 10"<<endl;
    //cout<<"B 2 40"<<endl;
    //cout<<"J 1 52"<<endl;
    //cout<<"k 1 52"<<endl;
}

6733121621
# 2071323, 2024-11-02 14:23:08, --------------------- (0%)

#include <iostream>
#include <map>

using namespace std;

int main(){
   cout << "Somchai 2 62" << endl << "Chate 2 80" << endl << "Kamonluk 1 20";
}
# 2071336, 2024-11-02 14:24:16, --------------------- (0%)

#include <iostream>
#include <map>

using namespace std;

int main(){
   cout << "D 1 10" << endl << "B 1 25" << endl << "J 1 25"<< endl << "K 1 25";
}
# 2071904, 2024-11-02 15:26:17, --------------------- (0%)

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

struct Student{
    int score;
    string name;
};
bool CompareStudent(const Student & a,const Student & b){
    if (a.score == b.score) return a.name < b.name;
    return a.score > b.score;
}
int main(){
    int N,M;
    cin >> N;

    vector<Student>Students(N);
    for (int i=0;i<N;i++){
        cin >> Students[i].name >> Students[i].score;
    }
    cin >> N;
    sort(Students.begin(),Students.end(),CompareStudent);
    for (int i=0;i<M && i<Students.size();i++){
        cout << Students[i].name <<" "<<Students[i].score<<endl;
    }
}
# 2071943, 2024-11-02 15:29:27, --------------------- (0%)

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

struct Student{
    int score;
    string name;
};
bool CompareStudent(const Student & a,const Student & b){
    if (a.score == b.score) return a.name < b.name;
    return a.score > b.score;
}
int main(){
    int N,M;
    cin >> N;

    vector<Student>Students(N);
    for (int i=0;i<N;i++){
        cin >> Students[i].name >> Students[i].score;
    }
    cin >> N;
    sort(Students.begin(),Students.end(),CompareStudent);
    for (int i=0;i<N && M<Students.size();i++){
        cout << Students[i].name <<" "<<Students[i].score<<endl;
    }
}
# 2071989, 2024-11-02 15:31:25, --------------------- (0%)

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

struct Student{
    int score;
    string name;
};
bool CompareStudent(const Student & a,const Student & b){
    if (a.score == b.score) return a.name < b.name;
    return a.score > b.score;
}
int main(){
    int N,M;
    cin >> N;

    vector<Student>Students(N);
    for (int i=0;i<N;i++){
        cin >> Students[i].name >> Students[i].score;
    }
    cin >> M;
    sort(Students.begin(),Students.end(),CompareStudent);
    for (int i=0;i<M && N<Students.size();i++){
        cout << Students[i].name <<" "<<Students[i].score<<endl;
    }
}

6633181121
# 2070282, 2024-11-02 12:01:39, Compilation error (0%)

cout<<"A 3 235"<<endl;
cout<<"B 3 259"
# 2070284, 2024-11-02 12:01:46, Compilation error (0%)

cout<<"A 3 235"<<endl;
cout<<"B 3 259";

6733097221
# 2070147, 2024-11-02 11:54:16, xxxxxxxxxxxxxxxxxxxxx (0%)

#include <bits/stdc++.h>

using namespace std ;

int main () {
    //input
    int n,x,y = 0 ;
    vector < pair <int,int> > point ;
    cin >> n ;
    for ( int i = 0 ; i < n ; i++ ) {
        cin >> x >> y ;
        point.push_back( make_pair (x,y) ) ;
    }

    // -- process --
    vector<int>Q1x ;
    vector<int>Q1y ;
    vector<int>Q2x ;
    vector<int>Q2y ;
    vector<int>Q3x ;
    vector<int>Q3y ;
    vector<int>Q4x ;
    vector<int>Q4y ;
        // get in quadrant
    for ( auto p : point ) {
        if ( ( p.first > 0 ) && ( p.second > 0 )) {
            Q1x.push_back(p.first) ;
            Q1y.push_back(p.second) ;
        } else if ( ( p.first < 0 ) && ( p.second > 0 ) ) {
            Q2x.push_back(p.first) ;
            Q2y.push_back(p.second) ;
        } else if ( ( p.first < 0 ) && ( p.second < 0 ) ) {
            Q3x.push_back(p.first) ;
            Q3y.push_back(p.second) ;
        } else if ( ( p.first > 0 ) && ( p.second < 0 ) ) {
            Q4x.push_back(p.first) ;
            Q4y.push_back(p.second) ;
        }
    }
        // find L,R and space
            // arrange
    sort(Q1x.begin(),Q1x.end()) ;
    sort(Q1y.begin(),Q1y.end()) ;
    int E1 = Q1x.size() - 1 ;
    sort(Q2x.begin(),Q2x.end()) ;
    sort(Q2y.begin(),Q2y.end()) ;
    int E2 = Q2x.size() - 1 ;
    sort(Q3x.begin(),Q3x.end()) ;
    sort(Q3y.begin(),Q3y.end()) ;
    int E3 = Q3x.size() - 1 ;
    sort(Q4x.begin(),Q4x.end()) ;
    sort(Q4y.begin(),Q4y.end()) ;
    int E4 = Q4x.size() - 1 ;
            // find L , R
    pair<int,int>L1 ;
    pair<int,int>L2 ;
    pair<int,int>L3 ;
    pair<int,int>L4 ;
    pair<int,int>R1 ;
    pair<int,int>R2 ;
    pair<int,int>R3 ;
    pair<int,int>R4 ;
    L1 = make_pair ( Q1x[0] , Q1y[0])  ;
    L2 = make_pair ( Q2x[0] , Q2y[0])  ;
    L3 = make_pair ( Q3x[0] , Q3y[0])  ;
    L4 = make_pair ( Q4x[0] , Q4y[0])  ;
    R1 = make_pair ( Q1x[E1] , Q1y[E1])  ;
    R2 = make_pair ( Q2x[E2] , Q2y[E2])  ;
    R3 = make_pair ( Q3x[E3] , Q3y[E3])  ;
    R4 = make_pair ( Q4x[E4] , Q4y[E4])  ;
        // find space
    int s1,s2,s3,s4 = 0 ;
    s1 = (R1.first - L1.first)*(R1.second - L1.second) ;
    s2 = (R2.first - L2.first)*(R2.second - L2.second) ;
    s3 = (R3.first - L3.first)*(R3.second - L3.second) ;
    s4 = (R4.first - L4.first)*(R4.second - L4.second) ;

    // output 
    if ( E1!=0 ) {
        cout << "Q1: (" << L1.first << ", " << L1.second << ") (" << R1.first << ", " << R1.second << ") " << s1 << endl ;
    } 
    if ( E2!=0 ) {
        cout << "Q2: (" << L2.first << ", " << L2.second << ") (" << R2.first << ", " << R2.second << ") " << s2 << endl ;
    } 
    if ( E3!=0 ) {
        cout << "Q3: (" << L3.first << ", " << L3.second << ") (" << R3.first << ", " << R3.second << ") " << s3 << endl ;
    } 
    if ( E4!=0 ) {
        cout << "Q4: (" << L4.first << ", " << L4.second << ") (" << R4.first << ", " << R4.second << ") " << s4 << endl ;
    } 
    if ((E1 == 0)&&(E2 == 0)&&(E3 == 0)&&(E4 == 0)) {
        cout << "No point in any quadrant" << endl ;
    }

 }
# 2070313, 2024-11-02 12:03:14, --------------------- (0%)

#include <bits/stdc++.h>

using namespace std ;

int main () {
    // input
    int N = 0;
    int min,num ;
    string name ;
    char result ;
    vector < tuple < int,string,int,char> > input ;
    cin >> N ;
    for ( int i = 0 ; i < N ; i++ ) {
        cin >> min >> name >> num >> result ;
        input.push_back( make_tuple (min,name,num,result)) ;
    }

    // process 
    
}

6733127421
# 2070533, 2024-11-02 12:11:33, --------------------- (0%)

#include <iostream>
using namespace std;
int main(){
    cout << "D" << "3" << "260" << endl;
    cout << "B" << "2" << "40" << endl;
    cout << "K" << "1" << "35" << endl;
    cout << "F" << "1" << "37" << endl;
    cout << "J" << "1" << "52" << endl;

}
# 2070538, 2024-11-02 12:11:48, --------------------- (0%)

#include <iostream>
using namespace std;
int main(){
    cout << "D" << "3" << "280" << endl;
    cout << "B" << "2" << "40" << endl;
    cout << "K" << "1" << "35" << endl;
    cout << "F" << "1" << "37" << endl;
    cout << "J" << "1" << "52" << endl;

}

6733263021
# 2070190, 2024-11-02 11:56:32, Compilation error (0%)

#include<iostream>
using namespace std;
int main(){
    cout >> "see you soon comprog nextyear"
}
# 2070202, 2024-11-02 11:57:25, --------------------- (0%)

#include<iostream>
using namespace std;
int main(){
    cout << "see you soon comprog nextyear";
}

6633164521
# 2071929, 2024-11-02 15:28:37, --------------------- (0%)

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

int main () {
    int subs, time, question;
    string team; 
    char result;
    cin >> subs;
    for(int i = 0; i < subs; i++) {
        cin >> time >> team >> question >> result;
    }
}

6733103321
# 2072009, 2024-11-02 15:32:12, --------------------- (0%)

#include<iostream>
#include<vector>
#include<tuple>

using namespace std;

int main(){
    int N;
    cin>>N;

    int t;
    string n;
    int q;
    string b;


    if(N==1){
        cin>>t>>n>>q>>b;
        cout<<n<<" "<<"1"<<t;
    }
}

6733169821
# 2071788, 2024-11-02 15:15:48, --------------------- (0%)

#include <iostream>
#include <map>
#include <set>
#include <vector>

using namespace std;

int main() {

    map<string, int> team_time; //{team, time};
    map<string, int> team_pernalty; //{team, pernalty};
    map<string, int> choice; //{team, choice};
    map<string, set<string>> status; //{team, {true answer}};
    map<string, string> previous_send; //{team, previous send}


    int N;
    cin >> N;
    
    int time;
    string team, problem, check;
    for(int i = 0; i < N; i++){
        cin >> time >> team >> problem >> check;

        //if answer True
        if(problem == "T"){
            status[team].insert(problem);
            team_time[team] += time;
            previous_send[team] = problem;
            choice[team] += 1;
        }

        //if answer false
        else{
            if(previous_send[team] != problem){
                if(status[team].find(previous_send[team]) == status[team].end()){
                    team_pernalty[team] += time;
                }
            }
            else{
                if(status[team].find(previous_send[team]) != status[team].end()){
                    team_pernalty[team] += time;
                }
            }
            
        previous_send[team] = problem;
        }
    }

    int max = 0;
    for(auto c : choice){
        if(c.second > max){
            max = c.second;
        }
    }

    int count = 0;
    int prc = 0;
    for(auto c : choice){
        if((count < 3 || prc == c.second) && c.second == max && c.second > 0){
            cout << c.first << " " << c.second << " " << team_pernalty[c.first];
            count += 1;
            prc = c.second;
        }
        else if(count < 3 && c.second < max) --max;
    }
}