2010年山东省第一届ACM大学生程序设计竞赛——Ivan comes again!

2010年10月ACM程序设计大赛 主要是2010ACM题目 及解题报告 涉及一些主要算法 用C或者C++解决 立即下载

题目链接:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2159

Ivan comes again!

题目大意:按照题目的操作做即可。。。简单的set应用。

#include<iostream>
#include<cstdio>
#include<cstring>
#include<set>
#include<algorithm>
using namespace std;
int main()
{
    int n,t=1;
    char str[20];
    int a,b;
    pair<int,int> p;
    while(scanf("%d",&n),n)
    {
        set<pair<int,int> > s;
        printf("Case %d:\n",t++);
        while(n--)
        {
            scanf("%s",str);
            scanf("%d%d",&p.first,&p.second);
            if(str[0]=='a')
                s.insert(p);
            else if(str[0]=='r')
                s.erase(p);
            else if(str[0]=='f')
            {
                set<pair<int,int> >::iterator it;
                it=s.lower_bound(p);    //指向一个不小于p的第一个值
                for(;it!=s.end();it++)
                {
                    if(it->first>p.first&&it->second>p.second)
                    {
                        cout<<it->first<<" "<<it->second<<endl;
                        break;
                    }
                }
                if(it==s.end())
                    cout<<-1<<endl;
            }
        }
        cout<<endl;
    }
    return 0;
}


从Xilinx FPGA到MIPI DSI LCD屏:手撸代码的实战经验分享 本文分享了使用Xilinx FPGA驱动MIPI DSI LCD屏的实战经验。作者从依赖官方IP核失败,到与底层D-PHY IP缠斗,最终通过手撸代码,直接配置GTY收发器原语并实现完整的D-PHY与DSI协议栈,成功点亮屏幕。文章详细剖析了协议细节、Vivado工具链的调试技巧与避坑指南,为FPGA工程师提供了从理论到实践的宝贵参考。 阅读详情

相关推荐

ComfyUI中一个超好用的变量管理类节点-KJNodes

在AI绘图中,ComfyUI的热度开始慢慢起来一些,但是这个软件在使用的过程中,需要很多连线,仅仅一个最简单的动画生成,就需要连接这么多线条,而且有些线会飞的很远,看起来就很不美观,尤其是一些复杂工作流,连接到最后自己可能已经分不太清楚到底连接好了没有。今天在研究C站的大佬们的工作流的时候,发现一个有意思的工作流,看起来大概是这种感觉:干净整洁。他用到了KJNodes这么个节点来管理变量,git上星标也不算很多,所以我想很多朋友可能还不知道,所以这里简单介绍下用法。

聚梦小课堂 7531

[2010山东省第一届ACM大学生程序设计竞赛]——Hello World!

山东省第一届ACM大学生程序设计竞赛(原题) Hello World!

继续激情,继续奋斗。 1900

SVG文件上传漏洞实战:从XSS攻击到防御策略

本文深入剖析了SVG文件上传漏洞的成因与危害,揭示了攻击者如何利用SVG的XML本质构造恶意文件,绕过常规检查实现存储型XSS攻击。文章通过实战复现演示了完整的攻击链,并提供了从严格内容检查、安全解析过滤到设置CSP策略等多层次的纵深防御方案,帮助开发者从根本上加固文件上传功能。

weixin_29230805的博客 406

第一届省赛 Ivan comes again! (set)

题目描述 The Fairy Ivan gave Saya three problems to solve (Problem F). After Saya finished the first problem (Problem H), here comes the second. This is the enhanced version of Problem H....

bandiaodai5734的博客 170

别再只会setStyleSheet了!Qt实现背景透明的5种方法全解析(附性能对比)

本文深入解析Qt实现背景透明的5种高阶方案,包括QPalette、setWindowOpacity、QGraphicsOpacityEffect、样式表和复合透明方案,并提供详细的性能对比与优化建议。针对不同平台和场景,帮助开发者选择最适合的透明效果实现方式,提升UI设计质量与性能表现。

weixin_27061475的博客 267

RK3576 PCIE接口调试:基于RTL8111HS的网卡驱动移植

检查项方法电源电压复位时序检查设备树 reset-gpios链路速率设备识别lspci -vvv驱动加载。

小灰灰的博客 757

Ivan comes again!

Description The Fairy Ivan gave Saya three problems to solve (Problem F). After Saya finished the first problem (Problem H), here comes the second. This is the enhanced version of Problem H.

AB 904

AMBA-CHI协议详解(七)

本节描述该协议包含的支持系统保序需求的机制。

Crazzy_M的博客 1166

山东省第一届ACM大学生程序设计竞赛(原题) Ivan comes again!

Ivan comes again! Time Limit: 1000MS Memory limit: 65536K 题目描述 The Fairy Ivan gave Saya three problems to solve (Problem F). After Saya finished the first problem (Problem H), here comes th

MY Blog 929

SpringBoot中使用FastJson解析Json数据

场景 1.SpringBoot默认配置的是Jackson。 2.项目搭建专栏: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/column/info/35688 实现 引入fastJson的依赖 <!-- fastjson的依赖 --> <dependency> <groupId>com.alibab...

BADAO_LIUMANG_QIZHI的博客 4142

RAP Draft Handling 全面拆解:从独占 Draft 到协作 Draft 的架构与落地实践

独占 Draft 的启用点在行为定义头部的with draft。with draft;create;update;delete;with draft;上面这段代码来自一个完整的 Draft 启用示例,包含了 Draft 表声明、锁策略、ETag、Draft 动作等关键要素。:告诉框架草稿存哪。:告诉框架如何做并发控制与一致性保护。:把草稿生命周期动作显式暴露出来,让 UI 与事务引擎能正确驱动流程。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 964

Ivan comes again!(2010年山东省第一届ACM大学生程序设计竞赛)

题目描述 The Fairy Ivan gave Saya three problems to solve (Problem F). After Saya finished the first problem (Problem H), here comes the second. This is the enhanced version of Problem H. There is a la

AC之路 661

从零开始学习AI人工智能本体论:概念与实战

本文旨在为初学者提供一个全面而易于理解的人工智能本体论入门指南。我们将覆盖从基本概念到实际应用的全过程,帮助读者理解本体论在AI系统中的核心作用。核心概念与联系:介绍本体论的基本概念和原理核心算法与操作步骤:详细讲解本体构建和推理方法项目实战:通过实际案例展示本体论的应用实际应用场景:探讨本体论在不同领域的应用未来发展趋势:展望本体论在AI领域的前景本体论(Ontology): 在AI中,指对特定领域概念及其关系的明确形式化描述。

AI智能探索者的博客 876

sdut 2159 Ivan comes again!(2010年山东省第一届ACM大学生程序设计竞赛) 线段树+离散...

先看看上一个题: 题目大意是:矩阵中有N个被标记的元素,然后针对每一个被标记的元素e(x,y),你要在所有被标记的元素中找到一个元素E(X,Y),使得X>x并且Y>y,如果存在多个满足条件的元素,先比较X,选择X最小的那个,如果还是有很多满足条件的元素,再比较Y,选择Y最小的元素,如果不存在就输出两个-1; 分析: 直接暴力就行了 这个题目大意: 这个题是上个题的坚强版...

weixin_30710457的博客 125

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

[2010山东ACM省赛] Ivan comes again!(set 的使用)

Ivan comes again! Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 The Fairy Ivan gave Saya three problems to solve (Problem F). After Saya finished the first problem (Pro

逆风的方向 更适合飞翔 2287

深度学习工具包 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")

山东省第一届ACM省赛 Ivan comes again!

set 的运用 #include #include #include #include #include #include using namespace std; int main() { pairp; int n,cnt=1; char op[10]; while(~scanf("%d",&n)&&n) { cout<<"Case

但求心安的博客 389

(SDUT 2159)山东省第一届ACM省赛 Ivan comes again! (set集合综合运用)

传送门:第一届ACM省赛题目大意:在矩阵上有三种操作:1.将一个未标记的点标记 2.将一个已标记的点去除标记 3.寻找比点 (x,y) 横纵坐标都大的最小点坐标。前置技能:本题用集合就可解决,但是比较综合,下面就来说下set集合的一些知识点,比较基础的我就不说了。1. struct结构体类型的 set的创建,例如:struct node { int x,y; }; bool operat...

zuzhiang的博客 285

Ivan comes again! set存放结构体

Problem DescriptionThe Fairy Ivan gave Saya three problems to solve (Problem F). After Saya finished the first problem (Problem H), here comes the second.This is the enhanced version of Problem H.Ther...

Little_boy_z的博客 318

sdut-2159 Ivan comes again!(set+线段树)

Ivan comes again! Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 The Fairy Ivan gave Saya three problems to solve (Problem F). After Saya finished the first problem

whoISVip 933

山东省第一届ACM大学生程序设计竞赛——Ivan comes again!(set+二分)

Problem Description The Fairy Ivan gave Saya three problems to solve (Problem F). After Saya finished the first problem (Problem H), here comes the second. This is the enhanced version of Problem H. T...

muyu__的博客 352

2010年ACM-ICPC亚洲区预选赛共设十五个赛区

<br />1. Amritapuri 阿姆里塔普里赛区<br />现场赛日期:2010年12月11日~12日<br />http://www.amrita.edu/icpc<br /><br />2. Chengdu 成都赛区(四川大学)<br />网络选拔赛日期:2010年9月18日<br />现场赛日期:2010年11月6日~7日<br />3. Dhaka 达卡赛区<br />http://www.northsouth.edu/acm/index.htm<br />4. Fuzhou 福州赛区(福州

1979

Codeforces 567D One-Dimensional Battle Ships

题目链接: http://codeforces.com/problemset/problem/567/D 解题思路: First, we should understand when the game ends. It will happen when on the n-sized board it will be impossible to place k ships of

piaocoder 1004

STL之一:vector用法详解

...

piaocoder 907

STL之二:set/multiset用法详解

使用set或multiset之前,必须加入头文件 Set、multiset都是集合类,差别在与set中不允许有重复元素,multiset中允许有重复元素。 sets和multiset内部以平衡二叉树实现 1.   常用函数 1)        构造函数和析构函数 set c:创建空集合,不包含任何元素 set c(op):以op为排序准则,产生一个空的set

piaocoder 750
上一篇: POJ2420——A Star not a Tree?
下一篇: 2010年山东省第一届ACM大学生程序设计竞赛——Ivan comes again!
yphacker
博客等级 码龄12年 199粉丝 540原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值