暑假集训第二场

Problem B. Dating With Girls
Input le: stdin
Output le: stdout
Time limit: 2 seconds
If you have a date with a pretty girl in a hurry, you can ignore what I will say next.
Hellis is a little bad guy in Rural Small Technical College. And the most important fact is that he is
especially fond of glaring at pretty girls! And as we all know, there are some girls he favors in the same
school. So there comes the trouble. On one terrible day, it should rains. The girls all are being di erent
places. They all phone him and ask the boy to deliver them umbrellas at the same time. However, the
cute boy faces the embarrassing condition. You can have a simple Understanding that each girl has a
special relationship with our sunny boy. If they know the boy sends the umbrella to anyone of them, the
others may go mad and that is not the boy expects. If that happens, Of course you will never see that
he is completing again. But the fact is some girls are so beautiful and he would like to give them help.
The trouble is this guy wants to meet more beautiful girls before he arrives at anyone who phones him
for help. It is just a disaster, he thinks. Eventually, he makes the choice. He will just send an umbrella
to only one girl who is most important to him, and he can not be seen by other girls who phones him
for help. If that happens, I can only say hehe. He must pass these girls. In the process, he can send
beautiful girls their umbrellas! In that case, he can create a chance to communicate with them and just
win their favorable impression. It is such a good idea!
There are n di erent places in our problem. There are m di erent undirectional edges. And there is no
loop. The bad guy starts at 1 node, and other 2 to n node stand di erent girls. Each girl is standing at
di erent nodes, too. The i-th girl has wi. When Hellis meets a girl, he can get jwij point, and he wants
to get max sum of point he gets.(wi < 0 means the i-th girl has phoned him for help).
Input
Multiple test cases. For each test case:
First line, two integers, n ,m (1 < n < 100, 1 < m < 5000)
2th to (m+1)th per line ,ai, bi (0 < ai n, 0 < bi n) means one road from ai to bi.
(m+2)th to (n+m)th per line, wi (0 < jwij 100, 2 i n)
Output
If the guy can meet the girl they chose, output line print a single integer ans )the max sum of point he
gets.
Else print /What is a fucking day!0(without the quotes).
Sample input and output
stdin stdout
3 3
1 2
1 3
2 3
-30
10
30

说实话刚看到这题的时候,这么一大段英文,但时立马就不想看了(虽然英语已经过了六级),但耐下心来仔细阅读,题目意思还是不难理解的,题目的大致意思是,有m条路,找到从点1出发,到达其他路中最大的权值。

#include<stdio.h>
#include<math.h>
#define INF 32767 //起点不是1的定位权值无限大
struct pp
{
 int x;//每条路的起点
 int y;//每条路的终点
 int z;//每条路的魅力值
}p[5000];
int main()
{
    int m,n,i;
    while(scanf("%d%d",&m,&n)!=EOF)
    {
    int j=0,max=0,a[100],flag=1;
    for(i=0;i<m;i++)
    {
    scanf("%d%d",&p[i].x,&p[i].y);
    p[i].z=INF;//初始每条路的魅力值为INF
    }
    for(i=1;i<=n-1;i++)
    {
    scanf("%d",&a[i]);//用数组a接收魅力值
    }
 j=1;
    for(i=0;i<m;i++)
    {
    if(p[i].x==1)
    p[i].z=a[j++];//把数组a中储存的魅力值赋给起点是1的路
    }
    for(i=0;i<m;i++)
    {
    if(p[i].x==1&&abs(p[i].z)>max)
    {
    max=abs(p[i].z);//找出起点是1 的路中,最大的魅力值
    flag=0;
    }
    }
   if(flag)
   printf("What is a fucking day!\n");
   else
   printf("%d\n",max);
}
return 0;
}
   
   
   

标题基于SpringBoot+Vue的社区便民服务平台研究AI更换标题第1章引言介绍社区便民服务平台的研究背景、意义,以及基于SpringBoot+Vue技术的研究现状和创新点。1.1研究背景与意义分析社区便民服务的重要性,以及SpringBoot+Vue技术在平台建设中的优势。1.2国内外研究现状概述国内外在社区便民服务平台方面的发展现状。1.3研究方法与创新点阐述本文采用的研究方法和在SpringBoot+Vue技术应用上的创新之处。第2章相关理论介绍SpringBoot和Vue的相关理论基础,以及它们在社区便民服务平台中的应用。2.1SpringBoot技术概述解释SpringBoot的基本概念、特点及其在便民服务平台中的应用价值。2.2Vue技术概述阐述Vue的核心思想、技术特性及其在前端界面开发中的优势。2.3SpringBoot与Vue的整合应用探讨SpringBoot与Vue如何有效整合,以提升社区便民服务平台的性能。第3章平台需求分析与设计分析社区便民服务平台的需求,并基于SpringBoot+Vue技术进行平台设计。3.1需求分析明确平台需满足的功能需求和性能需求。3.2架构设计设计平台的整体架构,包括前后端分离、模块化设计等思想。3.3数据库设计根据平台需求设计合理的数据库结构,包括数据表、字段等。第4章平台实现与关键技术详细阐述基于SpringBoot+Vue的社区便民服务平台的实现过程及关键技术。4.1后端服务实现使用SpringBoot实现后端服务,包括用户管理、服务管理等核心功能。4.2前端界面实现采用Vue技术实现前端界面,提供友好的用户交互体验。4.3前后端交互技术探讨前后端数据交互的方式,如RESTful API、WebSocket等。第5章平台测试与优化对实现的社区便民服务平台进行全面测试,并针对问题进行优化。5.1测试环境与工具介绍测试
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值