Problem : ZY的画像

PBRT_V2 总结记录 <21> CameraSample 和 Sample CameraSample 类 struct CameraSample { float imageX, imageY; float lensU, lensV; float time; }; 类的作用: (这个类代表的就是采样点,传入采样点给Camera ,会根据采样点生成 Ray,传入采样点给 Integrators,会执行光照计算 CameraSample 代表的只是作为生成射线的... 阅读详情

Problem : ZY的画像

Time Limit: 1 Sec Memory Limit: 128 MB

Description

ZY的学生们想要覆盖一大张巨大的ZY画像,他们在之前已经用林衡的照片覆盖了一小部分画像(但林衡的照片不一定在画像上)现在他们要取一块足够大的布来将画像剩下的部分覆盖,问至少要多大的矩形的布才能覆盖剩下的画像。

Input

输入共两行。
第一行四个整数,l1,r1,l2,r1,描述ZY画像左下和右上两个坐标(l1,r1)和(l2,r2)。
第二行四个整数,x1,y1,x2,y2,描述林衡照片的位置的左下和右上两个坐标(x1,y1)和(x2,y2)。
所有数值都在-1000~1000范围内。

Output

一行一个整数,表示需要的最小的矩形的布。

Sample Input

2 1 7 4
5 -1 10 3

Sample Output

15
HINT
在这个问题中,我们有一个部分被另一个矩形覆盖的矩形。我们希望计算覆盖矩形其余部分的最小面积的矩形。
在纸上画出一些例子后,我们发现有三种不同的情况。画像可能有四个角被覆盖,两个角被覆盖,或者少于两个角被覆盖。如果它有四个角被覆盖,那么它必须完全被覆盖,在这种情况下,面积为零。如果它有两个角被覆盖,那么我们就可以去掉两个画像区域的交叉点,剩下的区域就可以被完全覆盖了。如果它少于两个角,我们必须覆盖整个画像,因为其中一对对角将保持未覆盖状态。
code:

#include<stdio.h>
int l1,r1,l2,r2,x1,y1,x2,y2,sum,a,b,c,d;
int main() {
   
   
    scanf("%d %d %d %d %d %d %d %d",
特征工程--理解 构造特征的思路是这样, 我们知道每个用户的点击文章是与其历史点击的文章信息是有很大关联的, 比如同一个主题, 相似等等。 所以特征构造这块很重要的一系列特征是要结合用户的历史点击文章信息。我们已经得到了每个用户及点击候选文章的两列的一个数据集, 而我们的目的是要预测最后一次点击的文章, 比较自然的一个思路就是和其最后几次点击的文章产生关系, 这样既考虑了其历史点击文章信息, 又得离最后一次点击较近,因为新闻很大的一个特点就是注重时效性。 往往用户的最后一次点击会和其最后几次点击有很大的关联。 所以我们就可以 阅读详情

相关推荐

【Python实例第21讲】确定类个数的silhouette分析法

机器学习训练营——机器学习爱好者的自由交流空间(qq 群号:696721295) 在聚类问题中,Silhouette分析用来研究聚类结果的类间距离。Silhouette数值度量在相同类中的点,与不同类中的点相比的紧密程度。Silhouette图可视化这一测度,这样就提供了一种评价类个数的方法。 Silhouette值在[-1, 1]内,接近1表示样本远离邻近类,取0表示样本几乎在两个近邻类的决...

wong2016的博客 1万+

FetcherX chrome extension-crx插件

fetcherx.com 安装FetcherX chrome扩展程序您可以轻松地在任何网站上保存图像和视频。 支持语言:English,中文 (简体)

我的画像 girl.ai

博文链接:https://ice-cream.iteye.com/blog/210107

IDEA类和方法注释模板设置(非常详细)

IDEA类和方法注释模板设置(非常详细)

黑桃A的博客 10万+

基于STM32的宠物智能照护嵌入式系统设计

嵌入式系统是实现物联网终端设备本地化感知、决策与执行的核心技术载体,其关键在于多传感器融合、低功耗执行控制与轻量级云边协同。本文围绕环境监测(温湿度、烟雾、余粮)、机电执行(步进电机食盘、继电器风扇)和可靠通信(MQTT+ESP8266)三大技术主线,深入解析STM32F103在资源约束下的外设调度策略、ADC采样抗干扰设计、DHT11时序精准控制及HX711称重滤波算法等工程实践要点。系统强调本地闭环优先原则,确保离线基础功能可用,同时通过阿里云IoT平台实现远程监控与告警联动,为中小型智能硬件项目提供可

weixin_29155599的博客 293

Simulink与C/C++的无缝对接:自定义结构体变量导入实战指南

本文详细介绍了如何将C/C++自定义结构体导入Simulink环境,实现无缝数据对接。通过编写标准C头文件、配置MEX编译环境(如MinGW),并利用`Simulink.importExternalCTypes`函数,可将结构体转换为Simulink Bus对象,从而提升复杂系统模型的可读性、可维护性及仿真与代码生成效率。

weixin_29093017的博客 481

基于OpenMV与双舵机云台的激光追踪系统实战解析

本文详细解析了基于OpenMV摄像头与双舵机云台的激光追踪系统设计与实现。从硬件选型、图像识别算法到PID控制逻辑,全面介绍了如何构建一个高效稳定的激光追踪系统,并分享了电子设计竞赛中的实战经验与调试技巧。该系统在智能玩具、安防监控及教学演示等领域具有广泛应用前景。

prometheus9mon的博客 261

【人工智能-数据集】RML2018 时域信号的时序信号和星座图的图片信号生成方式(可用于多模态特征融合)

RML2018(RadioML 2018)数据集是一个广泛用于无线通信信号识别的开源数据集。它包含了多种调制方式(如OOK、QPSK、16QAM等)在不同信噪比下的信号样本。这些数据以 HDF5 格式存储,适用于大规模的数据处理和分析。数据集特点:多调制方式:涵盖24种不同的调制方式。多信噪比:包括从-20 dB到30 dB的26种信噪比。大规模样本:每种调制方式和信噪比下包含4096个样本。数据切分:将原始的 HDF5 数据集按照调制方式和信噪比切分成单个文件,便于后续处理。样本选择。

若北辰 971

实例详解C++程序的五大内存分区

本文详细讲述C++程序在运行时的5大内存分区。 下面使用日常开发中的编程实例,详细介绍一下这5个分区,以便大家能更深刻的理解这5大内存分区。 1、栈内存区 栈内存区是我们用的最多的分区,只要有函数的地方都会使用到这个分区。栈分区是用来存放函数参数及函数局部变量值的内存区,是由编译器在编译时自动分配和释放的。 函数中的参数与函数中的局部变量占用的内存是代码执行到函数(进入函数)是分配的,在............

dvlinker的技术专栏 1万+

使用C#和ASP.NET创建登录页面

在Visual Studio中,右键单击项目,选择"添加",然后选择"新建项"。在对话框中选择"Web",然后选择"Web 窗体"。在Visual Studio中,右键单击项目,选择"添加",然后选择"新建项"。在Visual Studio中,选择"新建项目",然后选择"ASP.NET Web应用程序"。在上面的代码中,我们创建了一个简单的用户界面,包含一个用户名输入框、一个密码输入框和一个登录按钮。在上面的代码中,我们创建了一个简单的用户界面,包含一个用户名输入框、一个密码输入框和一个登录按钮。

TzData的博客 763

【系统分析师】2026年上半年真题:论文及解题思路

四篇论文围绕系统与开发实践展开: 安全架构设计强调数据加密(国密算法)、零信任访问控制及容灾架构,以某医疗云平台为例,实现RTO<5分钟的高可用保障。 架构风格应用解析微服务/事件驱动等风格选型,结合电商平台案例,通过服务拆分与异步通信提升扩展性。 需求评审机制提出正式评审与走查结合的方法,在金融系统中减少30%返工,解决业务规则二义性问题。 LLM测试生成利用大模型从需求/代码生成用例,辅以人工校验,使测试效率提升50%,覆盖边缘场景。 各篇均遵循“背景-理论-实践”结构,突出

数据知道的博客 783

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: Problem : 恢复一棵树
下一篇: Problem : [Usaco2010 Nov]Race Results
赵崇延
博客等级 码龄8年 18粉丝 72原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值