2024ICPC第一场网络赛补题

The 2024 ICPC Asia East Continent Online Contest (I) - Dashboard - Contest - QOJ.ac

World Cup

静下心模拟很容易推,16round的时候,分成第一和第二的情况,如果第一就得赢3+3队,第二得赢2+4队,推出来6,后面double再+1就好。主要得沉下心简单推下。

#include<bits/stdc++.h>

using ll = long long;
using ull = unsigned long long;
using ari = std::array<int, 3>;
using PII = std::pair<int, int>;

const int N = 2e5 + 10;
const int mod = 1e9 + 7;
const double eps = 1e-6;

int a[N], b[N];

void solve() {

    for (int i = 1; i <= 32; i++) {
        std::cin >> a[i];
    }
    ll cnt = 0;

    for (int i = 1; i <= 32; i++) {
        if (a[i] < a[1]) cnt++;
    }

    if (cnt < 2) {
        std::cout << 32 << '\n';
    } else if (cnt < 6) {//至少6队比它菜
        std::cout << 16 << '\n';
    } else if (cnt < 13) {
        std::cout << 8 << '\n';
    } else if (cnt < 27) {
        std::cout << 4 << '\n';
    } else if (cnt < 31) {
        std::cout << 2 << '\n';
    } else std::cout << 1 << '\n';
}

signed main() {
    std::ios::sync_with_stdio(0);
    std::cin.tie(0);

    int t = 1;
    std::cin >> t;
    while (t--) {
        solve();
    }

    return 0;
}

Find the Easiest Problem - Problem - QOJ.ac

鉴定为pta nt模拟。。

#include<bits/stdc++.h>

using ll = long long;
using ull = unsigned long long;
using ari = std::array<int, 3>;
using PII = std::pair<int, int>;

const int N = 2e3 + 10;
const int mod = 1e9 + 7;
const double eps = 1e-6;

#define fir first
#define sec second

void solve() {
    int n;
    std::cin >> n;

    std::map<char, std::set<std::string> > mp;
    for (int i = 1; i <= n; i++) {
        std::string a, c;
        char b;
        std::cin >> a >> b >> c;

        if (c != "accepted") continue;

        mp[b].insert(a);
    }
    ll ans = 0;
    char res;

    for (auto &i: mp) {
        if (ans < i.sec.size()) {
            ans = i.sec.size();
            res = i.fir;
        }
    }
    std::cout << res << '\n';
}

signed main() {
    std::ios::sync_with_stdio(0);
    std::cin.tie(0);

    int t = 1;
    std::cin >> t;
    while (t--) {
        solve();
    }

    return 0;
}
/*
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
*/

菜狗是这样的先睡了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值