ZJU-PAT 1079. Total Sales of Supply Chain (25) 浙大2014年上机复试第三题

ZJU-PAT 1078. Hashing (25) 浙大2014年上机复试第二题 #include #include #include #include #include using namespace std; const int MaxN=20001; int n,m; bool Position[MaxN]; void special_process(int cur) { for(int i=1; i<m; i++) { int po 阅读详情
#include<iostream>
#include<cstdio>
using namespace std;

struct Node
{
    int parent;  //父节点
    bool flag;  //是否是retailers
    int level;   //第几层
    int num;    //销售多少个
};
Node tt[100005];

int n;
double p,r,sum;

int Jisuan(int num)
{
    if(tt[num].level!=-1)
        return tt[num].level;
    else
        return Jisuan(tt[num].parent)+1;
}

double Count[100005];

void run()
{
    scanf("%d",&n);
    scanf("%lf%lf",&p,&r);

    Count[0]=p;
    for(int i=1; i<100005; i++)
    {
        Count[i]=Count[i-1]*(1.0+r/100.0);
    }

    for(int i=1; i<n; i++)
    {
        tt[i].level=-1;
    }
    tt[0].level=0;

    for(int i=0; i<n; i++)
    {
        int tmp;
        scanf("%d",&tmp);

        if(tmp==0)
        {
            scanf("%d",&tmp);
            tt[i].flag=true;
            tt[i].num=tmp;
        }
        else
        {
            tt[i].flag=false;
            for(int j=0; j<tmp; j++)
            {
                int t;
                scanf("%d",&t);
                tt[t].parent=i;
            }
        }
    }


    for(int i=1; i<n; i++)
    {
        tt[i].level=Jisuan(i);
    }
    sum=0.0;
    for(int i=0; i<n; i++)
    {
        if(tt[i].flag==true) sum+=tt[i].num*Count[tt[i].level];
    }
    printf("%.1lf\n",sum);
}

int main()
{
    run();
    return 0;
}



#include<iostream>
#include<cstdio>
#include<queue>
using namespace std;

const int N=100005;

struct Node
{
    int parent;  //父节点
    vector<int> child; //孩子
    int level;   //第几层
    int num;    //销售多少个
};
Node tt[N];

int n;
double p,r,sum;

double Count[N];

void BFS()
{
    queue<Node> Q;
    Q.push(tt[0]);
    tt[0].level=0;

    while(!Q.empty())
    {
        Node tmp=Q.front();
        Q.pop();

        for(int i=0;i<tmp.child.size();i++)
        {
            tt[tmp.child[i]].level=tmp.level+1;
            Q.push(tt[tmp.child[i]]);
        }
    }
}

void Init()
{
    scanf("%d",&n);
    scanf("%lf%lf",&p,&r);

    Count[0]=p;
    for(int i=1; i<N; i++)
    {
        Count[i]=Count[i-1]*(1.0+r/100.0);
    }

    for(int i=0; i<n; i++)
    {
        int tmp;
        scanf("%d",&tmp);

        if(tmp==0)
        {
            scanf("%d",&tmp);
            tt[i].num=tmp;
        }
        else
        {
            tt[i].num=0;
            for(int j=0; j<tmp; j++)
            {
                int t;
                scanf("%d",&t);
                tt[t].parent=i;
                tt[i].child.push_back(t);
            }
        }
    }
}


void Jisuan()
{
    sum=0.0;
    for(int i=0; i<n; i++)
    {
        if(tt[i].num) sum+=tt[i].num*Count[tt[i].level];
    }
    printf("%.1lf\n",sum);
}

int main()
{
    Init();
    BFS();
    Jisuan();
    return 0;
}


【电力负荷预测】项目介绍 MATLAB实现基于BO-Transformer-LSTM贝叶斯优化算法(BO)优化Transformer-LSTM组合模型进行居民用户多步电力负荷预测(含模型描述及部分示例 内容概要:本文介绍了一个基于BO-Transformer-LSTM的组合模型,用于实现居民用户多步电力负荷预测的完整项目实例。该模型融合Transformer的全局注意力机制与LSTM的局部时序记忆能力,构建能够捕捉长时依赖与周期性特征的深度学习架构,并引入贝叶斯优化(BO)自动搜索最优超参数组合,提升预测精度与训练效率。项目涵盖从原始数据清洗、特征工程、滑动窗口样本构建、模型设计到超参数优化、反归一化及多步误差评估的全流程,强调时间顺序划分以防止信息泄露,并通过周期编码、外生变量融合等方式增强数据表达能力。文中提供了详细的MATLAB代码示例,包括数据预处理、网络搭建、贝叶斯优化配置和预测结果评估等关键步骤。 适合人群:具备一定机器学习和时间序列分析基础,熟悉MATLAB编程环境,从事电力系统预测、智能电网、负荷管理等相关领域的研究人员、工程师及研究生。 使用场景及目标:①应用于居民级或多用户聚合负荷的短期至中期多步预测(如未来24小时);②服务于配电系统运行调度、需求响应基线设定、家庭能源管理系统优化、分布式能源协调控制等实际工程场景;③为科研提供可复现的深度学习+贝叶斯优化的技术路线参考。 阅读建议:此资源以实际项目为导向,建议读者结合提供的代码逐步实现并调试模型,重点关注数据质量控制、时间特征编码、组合网络结构设计与贝叶斯优化稳定性之间的协同关系,在实践中深入理解多步预测中的误差累积机制与超参数敏感性问题。 立即下载

相关推荐

国央企创新负责人如何通过平台实现科研成果的快速识别与转化?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

ZOJ1079-Robotic Jigsaw

#include <stdio.h> #include <string.h> #include <algorithm> #include <iostream> using namespace std; int n, k; int dx[4] = {1,0,-1,0}; int dy[4] = {0,1,0,-1}; int queue[501]; ...

zjutsunny的博客 195

PotPlayer自用皮肤

自用 PotPlayer 皮肤,仅微调了字体大小与颜色,是按个人习惯调整,未做适配性调整。

ZJU-PAT 1010. Radix (25)

Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number. Now for any pair of positive

Matrix_Reloaded的专栏 4799

2-shell及常用命令-续.pdf

2-shell及常用命令-续.pdf

Shopee商品详情页反爬实战:手把手逆向x-sap-Ri和x-sap-Sec参数(附完整调试过程)

本文详细解析了Shopee商品详情页反爬机制中的x-sap-Ri和x-sap-Sec参数逆向过程。通过JS逆向技术,从环境数据采集到多层哈希运算,完整拆解了这两个关键参数的生成逻辑,并提供了实战技巧和Node.js实现方案,帮助开发者应对Shopee的动态加密挑战。

weixin_33701251的博客 1596

ZJU-PAT 1065. A+B and C (64bit) (20)

Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C. Input Specification: The first line of the input gives the positive number of test cases, T ( Output

Matrix_Reloaded的专栏 3966

统信UOS上Qt5.12.8离线安装保姆级教程(避坑网络登录与GCC选择)

本文提供统信UOS系统下Qt5.12.8离线安装的完整教程,涵盖环境准备、安装步骤、常见问题解决及开发优化建议。特别针对无网络环境下的登录验证跳过、GCC版本匹配等关键问题提供解决方案,帮助开发者快速搭建稳定的Qt开发环境。

weixin_30666401的博客 462

ZJU-PAT 1080. Graduate Admission (30) 浙大2014年上机复试第四题

#include #include #include #include using namespace std; const int maxn=40005; const int maxm=101; int n,m,k; int num[maxm]; int lastRank[maxm]; vector mm[maxm]; struct stu { int id; int G

Matrix_Reloaded的专栏 2509

论文阅读笔记---Deep HDR Video from Sequences with Alternating Exposures

Kalantari N K, Ramamoorthi R. Deep HDR Video from Sequences with Alternating Exposures[C]//Computer Graphics Forum. 2019, 38(2): 193-205. 摘要: 在本文中,提出了一种基于学习的方法来,我们使用两个顺序卷积神经网络(CNN)对整个HDR视频重建过程进...

qq_25283239的博客 1447

Paypal开发者中心获取“ClientId”和“ClientSecret”参数

正式环境设置 1、登录到 paypal开发者中心 网址:https://developer.paypal.com/developer/ 点击右上角登录按钮登录 2、左侧栏 - 我的应用程序和凭证 - 点击“创建新应用” 新注册的paypal账号,需要进行邮箱验证,验证通过后,需要等待一段时间(或重新登录),才会出现相关设置项位置 验证邮箱通过后,点击创建新应用 3、按提示填写,保存创建应用 4、点击刚创建的应用进入应用详情页 5、应用详情页获得网站开发人员所需要的“ClientId”和“Client

龚清林的博客 1万+

ZJU-PAT 1057. Stack (30) 浙大2013年上机复试第三题

#pragma warning (disable:4786) #include #include #include #include #include using namespace std; int n,d;; int A[10005],B[10005]; int select(int num) { for(int i=1;i<=d;i++) B[i]=A[i];

Matrix_Reloaded的专栏 1921

中兴SDH设备开局及业务配置

中兴SDH设备开局及业务配置 1.设备开局(S200-----S325) A.开电之后,按住截铃(bell off)开关,直至NCP告警灯变成橙色; B.此时,设备进入Download状态,设备IP为:192.192.192.11/24; 2.用交叉线(568A)将设备的QX口连接至电脑,电脑配置和设备相同网段的IP信息; 3.在电脑上测试连通性:pin...

weixin_33897722的博客 3996

ZJU-PAT 1070. Mooncake (25)

Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now

Matrix_Reloaded的专栏 1892

使用IntelliJ IDEA配置版本管理(SVN和Git)

在开发过程中,版本管理是必不可少的一部分,它可以帮助团队协作、管理代码历史记录,并且提供了代码回滚和分支管理等功能。本文将介绍如何使用IntelliJ IDEA配置版本管理,包括SVN和Git两种方式,另外列举了常见的问题并指导修复,以帮助开发者更高效地进行代码管理和协作。

2870

Android15音频进阶之AudioReach架构agmcap bringup调试(一百二十三)

本篇目的:Android15音频进阶之AudioReach架构agmcap录音调试。

Android系统攻城狮 2229

ZJU-PAT 1081. Rational Sum (20)

模拟题 #pragma warning (disable:4786) #include #include #include #include #include #include #include using namespace std; long long int sum,ans,sum1; int n; struct Node { long long int numerato

Matrix_Reloaded的专栏 1708

软件测试高频面试题 2026 最新整理(功能 + 自动化)

本文系统整理了2026年软件测试面试高频题目及参考答案,涵盖功能测试、自动化测试及新兴热点领域。功能测试部分包含测试基础概念、用例设计方法、缺陷管理流程等10个必背题;自动化测试部分详细解析工具选择、元素定位、框架搭建等10个热门考点;新增章节聚焦AI测试、安全测试、性能指标等5个前沿话题。参考答案均采用结构化表述,包含定义、区别、适用场景等关键要素,并强调结合项目经验作答。文末提供2026版面试技巧,建议采用"结论-分点-总结"的回答逻辑,重点展现问题解决能力和技术前瞻性。

SmallBull的博客 1968

ZJU-PAT 1054. The Dominant Color (20) 浙大2013年上机复试第一题

#pragma warning (disable:4786) #include #include #include #include using namespace std; int main() { int m,n; while(scanf("%d%d",&m,&n)!=EOF) { int i,j; string s; map ans;

Matrix_Reloaded的专栏 1612

visio安装包

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

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

ZJU-PAT 1077. Kuchiguse (20) 浙大2014年上机复试第一题

#include #include #include #include using namespace std; string longest_common_suffix(string a,string b) { string tmp=""; int len1=a.size()-1; int len2=b.size()-1; while(len1>=0 && len2>=0) {

Matrix_Reloaded的专栏 1413

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

ZJU-PAT 1055. The World's Richest (25) 浙大2013年上机复试第二题

#pragma warning (disable:4786) #include #include #include #include #include using namespace std; int m,n; int num,Min,Max; struct people { string name; int age,money; }; people TT[

Matrix_Reloaded的专栏 1339

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

ZJU-PAT 1056. Mice and Rice (25) 浙大2013年上机复试第四题

#pragma warning (disable:4786) #include #include #include #include #include #include using namespace std; int n,m; int B[100005]; int flag; int cnt;//第几轮次被淘汰 int group[1005],num_i

Matrix_Reloaded的专栏 1337

ZJU PAT 1012 The Best Rank

#include #include #include #include using namespace std; #define Min(a,b)(a<b?a:b) int n,m; struct student { int id,ctest,math,english; double avg; int crank,mrank,erank,arank; int bestrank; st

Matrix_Reloaded的专栏 1003

ZJU-PAT 1050

#include #include using namespace std; /* Sample Input: They are students. aeiou Sample Output: Thy r stdnts. */ bool myhash[150]; string s1,s2; void run() { getline(cin,s2); int i; string

Matrix_Reloaded的专栏 923

ZJU-PAT 1051 Pop Sequence

#include #include #include using namespace std; int m,n,cases; stack f; int a[1005]; bool Judge() { while(f.empty()==false) f.pop(); int i,j; for(i=0;i<n;i++) scanf("%d",&a[i]); if(a[0]>m) re

Matrix_Reloaded的专栏 787
上一篇: ZJU-PAT 1077. Kuchiguse (20) 浙大2014年上机复试第一题
下一篇: ZJU-PAT 1080. Graduate Admission (30) 浙大2014年上机复试第四题
Matrix_Reloaded
博客等级 码龄14年 18粉丝 36原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值