Audiophobia

hulft入门手册 hulft FTP服务入门资料,对日开发中会用到这类FTP服务器 立即下载

Consider yourself lucky! Consider yourself lucky to be still breathing and having fun participating in
this contest. But we apprehend that many of your descendants may not have this luxury. For, as you
know, we are the dwellers of one of the most polluted cities on earth. Pollution is everywhere, both in
the environment and in society and our lack of consciousness is simply aggravating the situation.
However, for the time being, we will consider only one type of pollution - the sound pollution. The
loudness or intensity level of sound is usually measured in decibels and sound having intensity level 130
decibels or higher is considered painful. The intensity level of normal conversation is 6065 decibels and
that of heavy traffic is 7080 decibels.
Consider the following city map where the edges refer to streets and the nodes refer to crossings.
The integer on each edge is the average intensity level of sound (in decibels) in the corresponding street.
To get from crossing A to crossing G you may follow the following path: A-C-F-G. In that case
you must be capable of tolerating sound intensity as high as 140 decibels. For the paths A-B-E-G,
A-B-D-G and A-C-F-D-G you must tolerate respectively 90, 120 and 80 decibels of sound intensity.
There are other paths, too. However, it is clear that A-C-F-D-G is the most comfortable path since
it does not demand you to tolerate more than 80 decibels.
In this problem, given a city map you are required to determine the minimum sound intensity level
you must be able to tolerate in order to get from a given crossing to another.
Input
The input may contain multiple test cases.
The first line of each test case contains three integers C(≤ 100), S(≤ 1000) and Q(≤ 10000) where
C indicates the number of crossings (crossings are numbered using distinct integers ranging from 1 to
C), S represents the number of streets and Q is the number of queries.
Each of the next S lines contains three integers: c1, c2 and d indicating that the average sound
intensity level on the street connecting the crossings c1 and c2 (c1 ̸= c2) is d decibels.
Each of the next Q lines contains two integers c1 and c2 (c1 ̸= c2) asking for the minimum sound
intensity level you must be able to tolerate in order to get from crossing c1 to crossing c2.
The input will terminate with three zeros form C, S and Q.
Output
For each test case in the input first output the test case number (starting from 1) as shown in the
sample output. Then for each query in the input print a line giving the minimum sound intensity level
(in decibels) you must be able to tolerate in order to get from the first to the second crossing in the
query. If there exists no path between them just print the line “no path”.
Print a blank line between two consecutive test cases.
Sample Input
7 9 3
1 2 50
1 3 60
2 4 120
2 5 90
3 6 50
4 6 80
4 7 70
5 7 40
6 7 140
1 7
2 6
6 2
7 6 3
1 2 50
1 3 60
2 4 120
3 6 50
4 6 80
5 7 40
7 5
1 7
2 4
0 0 0
Sample Output
Case #1
80
60
60
Case #2
40
no path
80
主要是把迪杰斯特拉的主要步骤变形,d[i][j] = min(d[i][j], max(d[i][x], a[x][j]));后面是这条路径上的最大噪声,min比较的是与其他路径最大噪音的比较,取最小。

#include<cstdio>
#include<cstring>
#include<iostream>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>
using namespace std;
typedef long long ll;
const int inf = 999999;
int a[105][105], leap[105], d[105][105];
int main()
{
    int i, j, m, n, ans, t, c, s, q, k, p = 1;
    while (scanf("%d%d%d", &c, &s, &q) != EOF)
    {
        if (!c&&!s&&!q)break;
        for (i = 1; i <= c;i++)
        for (j = 1; j <= c; j++)
        {
            a[i][j] = inf;
            d[i][j] = inf;
        }
        for (i = 1; i <= s; i++)
        {
            int x, y, z;
            cin >> x >> y >> z;
            a[x][y] = a[y][x] = z;
        }
        for (i = 1; i <= c - 1; i++)
        {
            memset(leap, 0, sizeof(leap));
            leap[i] = 1;
            for (j = 1; j <= c; j++)
                d[i][j] = a[i][j];
            d[i][i] = 0;
            for (k = 1; k < c; k++)
            {
                int x, temp;
                x = temp = 999999;
                for (j = 1; j <= c; j++)
                {
                    if (!leap[j] && d[i][j] <= temp)
                    {
                        temp = d[i][j];
                        x = j;
                    }
                }
                leap[x] = 1;
                for (j = 1; j <= c; j++)
                {
                    d[i][j] = min(d[i][j], max(d[i][x], a[x][j]));
                }
            }
        }
        if (p!=1)cout << endl;
        cout << "Case #" << p << endl;
        p++;
        for (i = 1; i <= q; i++)
        {
            int x, y;
            cin >> x >> y;
            if (x > y)swap(x, y);
            if (d[x][y] == inf)
                cout << "no path" << endl;
            else
                cout << d[x][y] << endl;
        }
    }
    return 0;
}
STM32按键中断切换红绿蓝灯 通过以上步骤,我们实现了使用STM32的按键中断来切换红绿蓝LED灯的功能。在实际应用中,可能还需要考虑更多的细节,如按键消抖、更精确的延时实现等。但上述代码提供了一个基本的框架和思路,可以根据具体需求进行扩展和优化。希望这篇博客对您有所帮助! 阅读详情

相关推荐

【CV论文精读】【BEV感知】BEVFormer:通过时空Transformer学习多摄像机图像的鸟瞰图表示

3D视觉感知任务,包括基于多摄像头图像的3D检测和地图分割,对于自动驾驶系统至关重要。在这项工作中,我们提出了一个称为BEVFormer的新框架,它通过时空Transformer学习统一的BEV表示,以支持多个自动驾驶感知任务。简而言之,BEVFormer通过预定义的网格形状的BEV queries与空间和时间进行交互,从而利用空间和时间信息。为了聚集空间信息,我们设计了空间交叉注意力,每个BEV query从跨摄像机视图的感兴趣区域中提取空间特征。

weixin_44184852的博客 6017

uva 10048 - Audiophobia

Problem B: Audiophobia 噪音恐惧症 Consider yourself lucky! Consider yourself lucky to be still breathing and having fun participating in this contest. 你是幸运的!你是幸运的仍有呼吸和快乐的参加这次竞赛 But we apprehend that m

lj102800的专栏 574

Windows Server 2022域控环境下的MDT部署工具安装与配置避坑指南

本文详细介绍了在Windows Server 2022域控环境中安装和配置MDT(Microsoft Deployment Toolkit)的全流程,包括ADK与Windows PE的精准安装、MDT高级配置、部署工作流构建及性能优化技巧。通过实战指南帮助IT管理员实现自动化系统部署,提升企业IT运维效率,特别适用于需要静默下发系统的大规模部署场景。

weixin_28481133的博客 435

送信

有一群无聊的人,共n个,编号1-n,他们互相发信,共有m个发信请求,每个请求ai,bi表示标号为ai希望将1封信发给bi,每个人有且只有一次到达邮筒的机会,到达邮筒时,他们先接收邮箱中发给自己的信,然后他们会将自己要发的信放在邮筒里。 每个人在(pi,qi)之间随机一个时间到达,这之中每个时间被选中的概率均等,此时间为0,100之间的实数。 收到信的总数的期望是多少。 输入格式:

Unknown 1063

SRAM故障排查实战:如何用Nano Prober定位6T存储单元的异常点

本文详细介绍了在SRAM故障排查中,如何运用Nano Prober(纳米探针)技术精准定位6T存储单元的内部异常。面对传统方法难以发现的电性参数漂移(如晶体管阈值电压偏移)或微小物理缺陷,Nano Prober能直接对单个6T单元内的晶体管进行I-V特性测量,结合失效模式分析,有效解决读写错误等疑难问题,是芯片失效分析的关键工具。

v5w6x的博客 664

F28335 DSP ePWM模块实战:从基础配置到电机控制

本文详细解析了TI TMS320F28335 DSP的ePWM模块,从基础概念、寄存器配置到实战应用。通过代码示例,手把手教你如何配置定时中断、生成PWM波形、实现死区保护与故障联防,并最终完成一个可调速、可换向的直流电机控制项目,是掌握F28335电机控制核心技术的实战指南。

g5h6i的博客 1127

Audiophobia UVA - 10048 噪音恐惧症 最短路

题目链接 输入一个C个点S条边(C≤100,S≤1000)的无向带权图,边权表示该路径上的噪声值。当噪声值太大时,耳膜可能会受到伤害,所以当你从某点去往另一个点时,总是希望路上经过的最大噪声值最小。输入一些询问,每次询问两个点,输出这两点间最大噪声值最小的路图。例如,在图中,A到G的最大噪声值为80,是所有其他路径中最小的(如ABEG的最大噪声值为90)。 【分析】 本题的做法十分简单:...

Nicolas的博客 1149

单神经元PID控制:从Hebb到Delta,四种学习规则在MATLAB里到底怎么选?

本文深入探讨了单神经元PID控制算法在MATLAB中的四种学习规则(无监督Hebb、有监督Delta、有监督Hebb及改进Hebb)的实战对比与选型指南。通过详细的仿真实验和性能指标分析,为工程师提供了基于实际工程考量的选型建议和参数整定技巧,帮助优化复杂非线性系统的控制效果。

weixin_31220401的博客 283

配信要求コマンド(utlsend)・コマンドライン書式

配信要求コマンド(utlsend)・コマンドライン書式 utlsend -f fileID [-p priority] [-file filename] [-t tgrp|-h hostname] [-msg0 message] [-msg1 message] [-msg2 message] [-msg3 message] [-msg4 message] [-msg5 m

山丘望月的狼 1万+

CentOS校园网Web Portal认证自动化实战

Web Portal认证是一种基于HTTP重定向与表单提交的强制网络准入机制,其原理是网关劫持未认证流量并跳转至登录页,验证通过后通过Cookie维持会话授权。该技术广泛应用于高校、机场、酒店等场景,核心价值在于细粒度访问控制与用户身份绑定。典型应用包括Linux命令行环境下的校园网接入、无GUI设备的自动联网、以及实验室集群的集中认证管理。本文聚焦CentOS系统,深入解析curl、cookie持久化、动态表单参数提取等关键技术环节,提供可调试、可复现、可工程化的完整认证流水线。

weixin_30522983的博客 264

H无穷控制学习笔记——加权灵敏度H无穷控制问题

一、加权灵敏度H无穷问题 系统结构如上图所示。被控对象P的状态空间方程为(Ap,Bp,Cp,DpA_p,B_p,C_p,D_pAp​,Bp​,Cp​,Dp​),加权函数W1的状态空间方程为(A1,B1,C1,D1A_1,B_1,C_1,D_1A1​,B1​,C1​,D1​),加权函数W2的状态空间方程为(A2,B2,C2,D2A_2,B_2,C_2,D_2A2​,B2​,C2​,D2​),加权函数W3的状态空间方程为(A3,B3,C3,D3A_3,B_3,C_3,D_3A3​,B3​,C3​,D3​)。

一饮丶一啄的博客 4349

UVA10048 - Audiophobia

                          UVA10048 - Audiophobia题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&amp;Itemid=8&amp;page=show_problem&amp;problem=989题意:给定N个点M条边,给定q个询问,询问x-y的路径上使得经过的每条边...

sortmin的博客 303

【中项第三版】系统集成项目管理工程师 | 第 1 章 信息化发展

【中项第三版】系统集成项目管理工程师 | 第 1 章 信息化发展

静谧、淡雅 6574

UVA 10048 Audiophobia (Floyd变形)

UVA 10048 Audiophobia (Floyd变形) 原题目网址 题意 输入一个C个点S条边(C≤100,S≤1000)的无向带权图,边权表示该路径上的噪声值。 当噪声值太大时,耳膜可能会受到伤害,所以当你从某点去往另一个点时,总是希望路上经 过的最大噪声值最小。输入一些询问,每次询问两个点,输出这两点间最大噪声值最小的路 路径。 思路 直接用Floyd算法,但是需要做一些改动: 加...

qq_43826794的博客 345

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

UVA10048 Audiophobia【Floyd算法】

Consider yourself lucky! Consider yourself lucky to be still breathing and having fun participating in this contest. But we apprehend that many of your descendants may not have this luxury. For, as you know, we are the dwellers of one of the most polluted

海岛Blog 488

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

UVA10048 - Audiophobia(Floyd,最大值的最小化)

UVA10048 - Audiophobia(Floyd,最大值的最小化) UVA10048 - Audiophobia 题目大意:给定一无向图,每条边都有一个权值,现在给你起点和终点,要求你找出起点到终点途经的边的最大值,要求这个值尽量小,到不了输出no path。 解题思路:在floyd过程中,就可以记录下来。G【i】【j】 = min(G【i】【j】, max(G【i】【k

684

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

uva 10048 Audiophobia(最小生成树)

题目链接:10048 - Audiophobia 题目大意:有n个城市,和m条街道,每条街道有一个噪音值,q次去问,从城市a到城市b,路径上分贝值的最大值最小为多少。 解题思路:与uva 10099的做法是一样的,可以参考一下。   #include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;algo...

weixin_33976072的博客 98

UVA10048Audiophobia

印证了一句话:比赛比的是对于算法的理解深度。 这道题是Floyd算法的变形,然而我没有反应过来,说明理解不够深入,需要重新看看推导过程,加深理解!!!

qq_16603365的博客 246

Audiophobia UVA - 10048 Floyd变形

题目链接: Audiophobia UVA - 10048 题目大意: 给一个无向图,有 c<=100 个点,s<=1000 条边,q<=10000 个询问,求给定两点之间的路径上的最大边权值最小。思路: 规模较小,据说可以用 MST 和 LCA做。 直接用Floyd做即可。需要注意的是 d数组的初始化。按照一般的做即可,即 d[i][i]=0 ,不连接的记为 inf注意d[i][j]=mi

Joovo的博客 376

UVA10048-Audiophobia-最短路

UVA10048-Audiophobia-最短路题面思路将最短路定义改为“一条途径边权值最大值最小的路径”,发现性质依然有传递性,依然满足最短路的结构 –》最短路,改条件数据这么小,用Floyd就好啦顺便有同学表示可以用最小生成树做,我感觉好像可以不过他WA了AC代码#include <cstdio> #include <iomanip> #include <cstring> #include <

君安在AreYouWell 508

UVaOJ 10048 - Audiophobia

——by A Code Rabbit Description 给你一张图。 求图上任意两点间,经过的路径中最大值最小的路径。 输入以边的方式表达的图。 输出所求路径上的最大值。 Types Graph Algorithms Analysis 询问任意两点间的最优路径,可以想到Floyd。 只要修改Floyd选边的策略就可以了。 Solution

A Code Rabbit 755

Uvaoj 10048 - Audiophobia(Floyd算法变形)

随笔 - 452文章 - 3评论 - 244 Uvaoj 10048 - Audiophobia(Floyd算法变形) 1 /* 2 题目大意: 3 从一个点到达另一个点有多条路径,求这多条路经中最大噪音值的最小值! 、 4 5 思路:最多有100个点,然后又是...

weixin_33924220的博客 164

UVA 10048 Audiophobia 最小生成树

//UVA 10048 - Audiophobia /* 题意:n个点,m条无向路,每条路有一个噪音指数,从两点间的路径中选一条路,使这条路的最大噪音指数最小 思路:排序+并查集 类似克鲁斯卡尔 */ #include #include #include #include using namespace std; #define N 105 int map[N][N]; int c,s,q;

God horses are clouds 745

[广义Floyd] UVA10048 噪音恐惧症 Audiophobia

Floyd的运用

阿巴阿巴 319

uva10048 - Audiophobia

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=116&page=show_problem&problem=989 题意很简单,找一条路径使得,这条路上最大的噪声量最小,这题是floyd的变种,直接用Floyd算法即可。和之前的题目相同。不过这题最坑爹的是输出格式,在最后不能多输出空行

BootStar 465
上一篇: Calling Circles
下一篇: Funny Car Racing
Techay
博客等级 码龄11年 11粉丝 174原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值