2024ICPC第一场网络赛补题

news/2024/9/25 15:41:27/

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 secondvoid 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
*/

菜狗是这样的先睡了


http://www.ppmy.cn/news/1530344.html

相关文章

pytest - 多线程提速

import timedef test1_test1():time.sleep(1)assert 1 1, "11"def test1_test2():time.sleep(1)assert 1 1, "11" 上面2个函数&#xff0c;执行情况&#xff1a; 正常执行时&#xff0c;花费 2.08s2个进程执行时&#xff0c;花费 1.18s2个线程执行时&a…

Android开发okhttp下载图片带进度

Android开发okhttp下载图片带进度 下载网络图片的方法有很多&#xff0c;这次介绍写用okhttp来下载网络图片&#xff0c;主要我看中的是用okhttp下载有进度返回&#xff0c;提示下用户 一、思路&#xff1a; 用OkHttpClient().newCall(request) 二、效果图&#xff1a; 三、…

物业管理小程序开发

物业小程序的开发是一个综合性的项目&#xff0c;旨在提升物业管理效率和增强业主的服务体验。以下是关于物业小程序开发的一些关键方面&#xff1a; 一、需求分析 目标用户&#xff1a;识别主要用户群体&#xff0c;包括业主、租户、物业管理人员等。 功能需求&#xff1a; 物…

Linux-TCP重传

问题描述&#xff1a; 应用系统进行切换&#xff0c;包含业务流量切换&#xff08;即TongWeb主备切换&#xff09;和MYSQL数据库主备切换。首先进行流量切换&#xff0c;然后进行数据库主备切换。切换后发现备机TongWeb上有两批次慢请求&#xff0c;第一批慢请求响应时间在133…

鸿蒙 OS 开发零基础快速入门教程

视频课程: 东西比较多, 这里主要分享一些代码和案例. 开关灯效果案例: 开灯 开关灯效果案例: 关灯 Column 和 Row 的基本用法 Entry Component struct Index {State message: string 张三;build() {// 一行内容Row() {// 一列内容Column() {// 文本内容Text(this.mess…

物联网迎来下半场,国产 IoTOS 打造企业级智能硬件云服务平台

如有需求&#xff0c;文末联系小编 氦氪云 IoTOS 是一套先进的企业级物联网解决方案平台&#xff0c;为万物互联提供可靠安全稳定的终端接入、协议适配、消息路由、数据存储和分析、应用使能等核心功能。面向物联网领域中的终端设备商、系统集成商、应用服务商、能力提供商等&a…

使用 React、Material-UI、Spring、MySQL、MyBatis 以及高德 API 模拟实时位置信息

要使用 React、Material-UI、Spring、MySQL、MyBatis 以及高德 API 模拟实时位置信息&#xff0c;你可以按以下步骤来实现&#xff1a; 目录 1. 前端 (React Material-UI) 2. 后端 (Spring Boot MyBatis MySQL) 3. 模拟实时位置数据 4. 前后端联调 1. 前端 (React Mat…

PHP API 框架:构建高效API的利器【电商API接口】

在当今快速发展的互联网时代&#xff0c;API&#xff08;应用程序编程接口&#xff09;已成为连接不同应用程序和服务的关键。PHP&#xff0c;作为一种流行的服务器端脚本语言&#xff0c;提供了多种强大的框架来简化API的开发。本文将介绍PHP API框架的重要性&#xff0c;以及…