活动调度 ╰半橙微兮° 2022-05-27 21:00 18阅读 0赞 ## 活动调度 ## <table style="max-width:100%;border-spacing:0px;width:1650px;margin-bottom:20px;background-color:transparent;"> <tbody> <tr> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">成绩</td> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">10</td> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">开启时间</td> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">2018年03月2日 星期五 12:20</td> </tr> <tr> <td style="padding:4px;line-height:20px;vertical-align:middle;">折扣</td> <td style="padding:4px;line-height:20px;vertical-align:middle;">0.8</td> <td style="padding:4px;line-height:20px;vertical-align:middle;">折扣时间</td> <td style="padding:4px;line-height:20px;vertical-align:middle;">2018年12月2日 星期日 12:20</td> </tr> <tr> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">允许迟交</td> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">否</td> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">关闭时间</td> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">2018年12月3日 星期一 12:20</td> </tr> </tbody> </table> 输入要求: 第一行为活动的个数 N(1<=N<=1 000 000) 。 接下来 N 行为 Si 和 Fi(0<=Si<Fi<=2 000 000 000) ,分别代表第 i 个活动的开始时间和结束时间。活动 i 的区间段为 \[Si,Fi) 输出要求: 输出有一行 M ,为所需教室的最小数量。 <table style="max-width:100%;border-spacing:0px;width:1650px;margin-bottom:20px;background-color:transparent;"> <thead> <tr> <th style="padding:4px;line-height:20px;vertical-align:bottom;border-top-width:0px;"> </th> <th style="padding:4px;line-height:20px;vertical-align:bottom;border-top-width:0px;">测试输入<span><a href="http://online.bit.edu.cn/moodle/help.php?component=programming&identifier=input&lang=zh_cn" title="关于“测试输入”的帮助" style="color:rgb(67,142,185);" rel="nofollow"><img src="http://online.bit.edu.cn/moodle/theme/image.php/lambda/core/1510491239/help" alt="关于“测试输入”的帮助" style="vertical-align:text-bottom;border:0px;height:16px;padding-left:3px;width:16px;"></a></span></th> <th style="padding:4px;line-height:20px;vertical-align:bottom;border-top-width:0px;">期待的输出<span><a href="http://online.bit.edu.cn/moodle/help.php?component=programming&identifier=expectedoutput&lang=zh_cn" title="关于“期待的输出”的帮助" style="color:rgb(67,142,185);" rel="nofollow"><img src="http://online.bit.edu.cn/moodle/theme/image.php/lambda/core/1510491239/help" alt="关于“期待的输出”的帮助" style="vertical-align:text-bottom;border:0px;height:16px;padding-left:3px;width:16px;"></a></span></th> <th style="padding:4px;line-height:20px;vertical-align:bottom;border-top-width:0px;">时间限制<span><a href="http://online.bit.edu.cn/moodle/help.php?component=programming&identifier=timelimit&lang=zh_cn" title="关于“时间限制”的帮助" style="color:rgb(67,142,185);" rel="nofollow"><img src="http://online.bit.edu.cn/moodle/theme/image.php/lambda/core/1510491239/help" alt="关于“时间限制”的帮助" style="vertical-align:text-bottom;border:0px;height:16px;padding-left:3px;width:16px;"></a></span></th> <th style="padding:4px;line-height:20px;vertical-align:bottom;border-top-width:0px;">内存限制<span><a href="http://online.bit.edu.cn/moodle/help.php?component=programming&identifier=memlimit&lang=zh_cn" title="关于“内存限制”的帮助" style="color:rgb(67,142,185);" rel="nofollow"><img src="http://online.bit.edu.cn/moodle/theme/image.php/lambda/core/1510491239/help" alt="关于“内存限制”的帮助" style="vertical-align:text-bottom;border:0px;height:16px;padding-left:3px;width:16px;"></a></span></th> <th style="padding:4px;line-height:20px;vertical-align:bottom;border-top-width:0px;">额外进程<span><a href="http://online.bit.edu.cn/moodle/help.php?component=programming&identifier=nproc&lang=zh_cn" title="关于“{$a} 个额外进程”的帮助" style="color:rgb(67,142,185);" rel="nofollow"><img src="http://online.bit.edu.cn/moodle/theme/image.php/lambda/core/1510491239/help" alt="关于“{$a} 个额外进程”的帮助" style="vertical-align:text-bottom;border:0px;height:16px;padding-left:3px;width:16px;"></a></span></th> </tr> </thead> <tbody> <tr> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">测试用例 1</td> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);"><a href="http://online.bit.edu.cn/moodle/mod/programming/testcase/download_io.php?id=71142&test=90949&type=in&download=0" style="color:rgb(67,142,185);font-size:9pt;" rel="nofollow">以文本方式显示</a> <div style="vertical-align:top;padding:0px 5px 0px 0px;width:10em;height:10em;"> <ol style="margin-bottom:0px;margin-left:2.5em;"> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">11↵</span></li> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">1 4↵</span></li> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">3 5↵</span></li> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">0 6↵</span></li> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">5 7↵</span></li> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">3 8↵</span></li> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">5 9↵</span></li> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">6 10↵</span></li> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">8 11↵</span></li> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">8 12↵</span></li> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">2 13↵</span></li> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">12 14↵</span></li> </ol> </div></td> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);"><a href="http://online.bit.edu.cn/moodle/mod/programming/testcase/download_io.php?id=71142&test=90949&type=out&download=0" style="color:rgb(67,142,185);font-size:9pt;" rel="nofollow">以文本方式显示</a> <div style="vertical-align:top;padding:0px 5px 0px 0px;width:10em;height:10em;"> <ol style="margin-bottom:0px;margin-left:2.5em;"> <li style="font-family:Consolas, 'Courier New', Courier, mono, serif;margin:0px;padding:0px;"><span style="margin:0px;padding:0px;white-space:nowrap;background-color:rgb(211,211,211);">5↵</span></li> </ol> </div></td> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">2秒</td> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">64M</td> <td style="padding:4px;line-height:20px;vertical-align:middle;background-color:rgb(249,249,249);">0</td> </tr> </tbody> </table> ![70][] #include<iostream> #include<algorithm> using namespace std; #define Maxn 1000005 int s[Maxn]; int f[Maxn]; int N; int main() { //freopen("1.txt", "r", stdin); cin >> N; for (int i = 0; i < N; i++) cin >> s[i] >> f[i]; sort(s, s + N); sort(f, f + N); int ans = 0; int cnt = 0; int i=0, j=0; while (i < N&&j < N)//类似于归并排序 { if (s[i] < f[j])//遇到左 { cnt++; i++; ans = max(ans, cnt); } else if (s[i]>f[j])//遇到右 { cnt--; j++; } else//遇到左右两数相等 { cnt--; j++; cnt++; i++; ans = max(ans, cnt); } } cout << ans<<endl; return 0; } [70]: /images/20220528/ccacc4b5dbb94e929f0464de1ba463b9.png
相关 活动选择 欢迎访问我的个人博客:[苦酒的个人小站][Link 1] 题目描述 Problem Description 学校的大学生艺术中心周日将面向全校各个学院的学生社团开放 深藏阁楼爱情的钟/ 2023年06月13日 11:13/ 0 赞/ 100 阅读
相关 活动选择 Problem Description 学校的大学生艺术中心周日将面向全校各个学院的学生社团开放,但活动中心同时只能供一个社团活动使用,并且每一个社团活动开始后都不能中断。现 电玩女神/ 2022年07月13日 03:49/ 0 赞/ 251 阅读
相关 活动选择 活动选择 Time Limit: 1000MS Memory Limit: 65536KB [Submit][] [Statistic][] Pro 青旅半醒/ 2022年07月12日 01:30/ 0 赞/ 244 阅读
相关 活动选择 活动选择 Time Limit: 1000MS Memory Limit: 65536KB [Submit][] [ Statistic][S 怼烎@/ 2022年06月17日 09:49/ 0 赞/ 222 阅读
相关 活动调度 活动调度 <table style="max-width:100%;border-spacing:0px;width:1650px;margin-bottom:20px; ╰半橙微兮°/ 2022年05月27日 21:00/ 0 赞/ 19 阅读
相关 活动选择 活动选择 Problem Description 学校的大学生艺术中心周日将面向全校各个学院的学生社团开放,但活动中心同时只能供一个社团活动使用,并且每一个社团活动开始后 亦凉/ 2022年05月16日 13:11/ 0 赞/ 234 阅读
相关 活动选择 活动选择 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Problem Description 女爷i/ 2022年05月16日 13:09/ 0 赞/ 280 阅读
相关 活动图 文章目录 定义 基本建模元素 用途 定义 活动图描述了在一个过程中,顺序的或并行的活动及其之间的关系。 应用于商业过程,工作流(业务过程 朱雀/ 2022年02月28日 06:24/ 0 赞/ 301 阅读
相关 活动选择 活动选择 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 学校的大学生艺术中心周日将面 墨蓝/ 2022年02月16日 14:18/ 0 赞/ 312 阅读
相关 go调度: 第一部分-OS调度(操作系统调度) 开场白 这个是三篇博客中的第一篇, 用来提供go调度背后的机制和语法. 这篇博客主要关注操作系统调度. 三篇博客的顺序是: 1) go调度: 第一部分 \- 操作系统调度 拼搏现实的明天。/ 2021年11月26日 16:42/ 0 赞/ 524 阅读
还没有评论,来说两句吧...