zoj 3263 Immaterial and Missing Power (二分)

本文深入探讨了游戏开发领域的关键技术,包括游戏引擎、Unity、Cocos2d-X等,以及AI音视频处理的应用,如语义识别、物体检测、语音识别等。同时,文章还涉及了开发工具、大数据开发、测试等方面的内容,为读者提供了一个全面的技术视角。
Immaterial and Missing Power

Time Limit: 8 Seconds       Memory Limit: 32768 KB       Special Judge

Spring has passed by the land of Gensokyo, a reclusive realm in the far east, and the cherry trees have since shred their blossoms. However, the hanami(flower viewing) kept on going, with feasts being hosted day after day with no end in sight. Adding onto that, every time the feast is held, an unknown restless spiritual aura in Gensokyo also increases; however, nothing happens even while the spiritual aura rises, but when the spiritual aura rises, not a single person attempts to stop the feasts. As such, everyone who goes to the feast, be it human or youkai(phantoms), appears to be very suspicious. The truth is that Ibuki Suika, an oni(ogre) who loves drinks, feasts, and competition, uses her ability to control density to gather people to form a banquet. And she scatters herself to become mist to attend it.

Immaterial&MissingPower(pic)

There are N places and M roads in Gensokyo. Suika wants to made Q residents of Gensokyo have a feast at Hakurei Shrine as soon as possible. Each resident will start off from her residence, choose the fastest route and move at speed Vi. What's more, residents in Gensokyo prefer to "yukkuri shiteitte ne!"("take it easy!"), resident Ri will spend time Tij playing at place Pj once she gets there, excluding the starting and terminal. However, Suika can use her ability to increase one's Vi by Ai * sqrt(ci). As the limit of her ability, the total sum of ci cannot exceed a given number C.

What's the minimum time that Suika needs to wait for before all residents get to Hakurei Shrine to begin the feast.

Input

There are about 16 cases. Process to the end of file.

Each case begins with 3 integers 1 <= N <= 100, 1 <= M <= 1000, 1 <= Q <= 16. Then N places. Each place is identified by its name whose length is less than 30. Then M roads. Each road is represent by two string PaPb, its two ends, and a real number Dab, the distance. Then Q residents. Each resident contains two strings Xi and Pi, her name and her residence, and 2 + N real numbers, ViAiTi1Ti2, ..., TiN. The case ends with a real number C. All real numbers are in range [0.1, 1000000].

Output

The minimum time on separate lines.

Answer having an absolute or relative error less than 1e-6 will be accepted. You can assume that the answer always exists.

Sample Input

2 2 1
Eientei
Hakurei_Shrine
Hakurei_Shrine Eientei 2.72
Eientei Hakurei_Shrine 3.14
Reisen_Udongein_Inaba Eientei 0.1 0.2 0.3 0.4
1
8 11 9
Hakurei_Shrine
Forest_of_Magic(Marisa's_house)
Forest_of_Magic(Alice's_house)
Misty_Lake
Scarlet_Devil_Mansion
Mayohiga
Poltergeist_Mansion
Hakugyokurou
Hakurei_Shrine      Misty_Lake                      218
Hakurei_Shrine	    Forest_of_Magic(Marisa's_house) 192
Hakurei_Shrine      Forest_of_Magic(Alice's_house)  255
Misty_Lake          Forest_of_Magic(Marisa's_house) 51
Misty_Lake          Forest_of_Magic(Alice's_house)  49
Misty_Lake          Mayohiga                        66
Mayohiga            Forest_of_Magic(Alice's_house)  77
Misty_Lake          Scarlet_Devil_Mansion           221
Poltergeist_Mansion Forest_of_Magic(Alice's_house)  71
Poltergeist_Mansion Hakugyokurou                    73
Hakugyokurou        Scarlet_Devil_Mansion           90
Hakurei_Reimu       Hakurei_Shrine                  0.4 0.1 99 99 99 99 99 99 99 99
Kirisame_Marisa     Forest_of_Magic(Marisa's_house) 0.6 0.2 88 77 66 55 44 33 22 11
Izayoi_Sakuya       Scarlet_Devil_Mansion           0.4 0.3 77 10 10 10 10 10 10 10
Alice_Margatroid    Forest_of_Magic(Alice's_house)  0.4 0.2 66 11 22 33 44 55 66 77
Patchouli_Knowledge Scarlet_Devil_Mansion           0.5 0.3 55 15 15 15 15 15 15 15
Konpaku_Youmu       Hakugyokurou                    0.6 0.1 44 11 13 17 19 23 29 31
Remilia_Scarlet     Scarlet_Devil_Mansion           0.6 0.3 33 99 99 88 88 88 11 11
Saigyouji_Yuyuko    Hakugyokurou                    0.4 0.1 22 31 29 23 19 17 13 11
Hong_Meiling        Scarlet_Devil_Mansion           0.5 0.2 11 22 33 44 55 66 77 88
49

Sample Output

9.06666768697071727374757677787980
484.202020202020202020202020202020

External Links

TeamShanghaiAlice(banner) 
Wikipedia
Touhou Wiki


Author:  WU, Zejun

Source: ZOJ Monthly, November 2009


二分套二分。精度问题,样例都没过交一发竟然AC了?!!

#include<cstdio>
#include<map>
#include<queue>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<list>
#include<set>
#include<cmath>
using namespace std;
const int maxn = 1e2 + 5;
const int INF = 1e9;
const double eps = 1e-7;
typedef unsigned long long ULL;
typedef long long LL;
typedef pair<int, double> P;
#define fi first
#define se second

map<string, int> M;
vector<P> G[maxn];
int pos[20];
double V[20], A[20], T[maxn][20];
int sink, q, n;
double C;
double dist[maxn];

struct Node{
    int pos;
    double dis;
    bool operator < (const Node& e) const{
        return dis > e.dis;
    }
};

double get(int source, double ci, int from){
    double v = A[source]*sqrt(ci) + V[source];
    priority_queue<Node> q;
    while(!q.empty())
        q.pop();
    for(int i = 0;i < n;i++)
        dist[i] = 1e12;
    dist[from] = 0;
    q.push((Node){from, 0});

    while(!q.empty()){
        Node tem = q.top();
        q.pop();
        int pos = tem.pos;
        double dis = tem.dis;

        if(dis > dist[pos])
            continue;
        if(pos == sink){
            return dis;
        }
        for(int i = 0;i < G[pos].size();i++){
            P& edge = G[pos][i];
            int to = edge.fi;
            double der = edge.se;
            if(dist[to] > dis+der/v+T[to][source]){
                dist[to] =  dis+der/v+T[to][source];
                q.push((Node){to, dist[to]});
            }
        }
    }
}

bool can(double limit){
    double left = C;
    for(int i = 0;i < q;i++){
        double l = 0, r = 1e7, ans = 1e6;
        for(int c = 0;c < 100;c++){
            double mid = (l+r)/2;
            if(limit-get(i, mid, pos[i])>eps){
                ans = mid;
                r = mid;
            }
            else
                l = mid;
        }
        left -= ans;
    }
    if(left < eps)
        return false;
    return true;
}

int main(){
    int m;
    while(scanf("%d%d%d", &n, &m, &q) != EOF){
        M.clear();
        for(int i = 0;i < n;i++)
            G[i].clear();
        for(int i = 0;i < n;i++){
            string s;
            cin >> s;
            M[s] = i;
            if(s == "Hakurei_Shrine")
                sink = i;
        }
        while(m--){
            string s;
            cin >> s;
            int x = M[s];
            cin >> s;
            int y = M[s];
            double dis;
            cin >> dis;
            G[x].push_back(P(y, dis));
            G[y].push_back(P(x, dis));
        }
        for(int i = 0;i < q;i++){
            string s;
            cin >> s >> s >> V[i] >> A[i];
            pos[i] = M[s];
            for(int j = 0;j < n;j++)
                cin >> T[j][i];
            T[sink][i] = 0;
        }
        cin >> C;

        double l = 0, r = 1e12;
        double ans;
        for(int c = 0;c < 100;c++){
            double mid = (l+r)/2;
            if(can(mid)){
                r = mid;
                ans = mid;
            }
            else
                l = mid;
        }
        printf("%.7lf\n", ans);
    }
    return 0;
}


【四轴飞行器】非线性三自由度四轴飞行器模拟器研究(Matlab代码实现)内容概要:本文围绕非线性三自由度四轴飞行器模拟器的研究展开,重点介绍基于Matlab代码实现的四轴飞行器动力学建模与仿真方法。研究构建了考虑非线性特性的飞行器数学模型,涵盖姿态动力学与运动学方程,实现了三自由度(滚转、俯仰、偏航)的精确模拟。文中详细阐述了系统建模过程、控制算法设计思路及仿真结果分析,帮助读者深入理解四轴飞行器的飞行动力学特性与控制机制;同时,该模拟器可用于算法验证、控制器设计与教学实验。; 适合人群:具备一定自动控制理论基础和Matlab编程能力的高校学生、科研人员及无人机相关领域的工程技术人员,尤其适合从事飞行器建模、控制算法开发的研究生和初级研究人员。; 使用场景及目标:①用于四轴飞行器非线性动力学特性的学习与仿真验证;②作为控制器(如PID、LQR、MPC等)设计与测试的仿真平台;③支持无人机控制系统教学与科研项目开发,提升对姿态控制与系统仿真的理解。; 阅读建议:建议读者结合Matlab代码逐模块分析,重点关注动力学方程的推导与实现方式,动手运行并调试仿真程序,以加深对飞行器姿态控制过程的理解。同时可扩展为六自由度模型或加入外部干扰以增强仿真真实性。
基于分布式模型预测控制DMPC的多智能体点对点过渡轨迹生成研究(Matlab代码实现)内容概要:本文围绕“基于分布式模型预测控制(DMPC)的多智能体点对点过渡轨迹生成研究”展开,重点介绍如何利用DMPC方法实现多智能体系统在复杂环境下的协同轨迹规划与控制。文中结合Matlab代码实现,详细阐述了DMPC的基本原理、数学建模过程以及在多智能体系统中的具体应用,涵盖点对点转移、避障处理、状态约束与通信拓扑等关键技术环节。研究强调算法的分布式特性,提升系统的可扩展性与鲁棒性,适用于多无人机、无人车编队等场景。同时,文档列举了大量相关科研方向与代码资源,展示了DMPC在路径规划、协同控制、电力系统、信号处理等多领域的广泛应用。; 适合人群:具备一定自动化、控制理论或机器人学基础的研究生、科研人员及从事智能系统开发的工程技术人员;熟悉Matlab/Simulink仿真环境,对多智能体协同控制、优化算法有一定兴趣或研究需求的人员。; 使用场景及目标:①用于多智能体系统的轨迹生成与协同控制研究,如无人机集群、无人驾驶车队等;②作为DMPC算法学习与仿真实践的参考资料,帮助理解分布式优化与模型预测控制的结合机制;③支撑科研论文复现、毕业设计或项目开发中的算法验证与性能对比。; 阅读建议:建议读者结合提供的Matlab代码进行实践操作,重点关注DMPC的优化建模、约束处理与信息交互机制;按文档结构逐步学习,同时参考文中提及的路径规划、协同控制等相关案例,加深对分布式控制系统的整体理解。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值