Dasha and Stairs

静态时序分析Static Timing Analysis1——STA概述、标准工艺库、时钟、IO约束的建立 简要介绍STA和标准工艺库内容,对时钟,IO等进行约束的指令介绍,PVT 阅读详情

Dasha and Stairs

time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

On her way to programming school tiger Dasha faced her first test — a huge staircase!

The steps were numbered from one to infinity. As we know, tigers are very fond of all striped things, it is possible that it has something to do with their color. So on some interval of her way she calculated two values — the number of steps with even and odd numbers.

You need to check whether there is an interval of steps from the l-th to the r-th (1 ≤ l ≤ r), for which values that Dasha has found are correct.

Input

In the only line you are given two integers a, b (0 ≤ a, b ≤ 100) — the number of even and odd steps, accordingly.

Output

In the only line print "YES", if the interval of steps described above exists, and "NO" otherwise.

Examples
input
2 3
output
YES
input
3 1
output
NO
Note

In the first example one of suitable intervals is from 1 to 5. The interval contains two even steps — 2 and 4, and three odd: 1, 3 and 5.


解题说明:此题是一道模拟题,给定奇数偶数个数,很显然,奇偶数相差必须为不超过1才行。

一直不对,结果发现最后才知道ab不能为零,mmp

    #include<stdio.h>  
    #include<string.h>  
    #include<math.h>  
      
    int main()  
    {  
        int a,b;  
        scanf("%d %d",&a,&b);  
        if(abs(b-a)<=1&&(b!=0||a!=0))  
        {  
            printf("YES\n");  
        }  
        else  
        {  
            printf("NO\n");  
        }  
        return 0;  
    }  


相机Camera日志分析之二:高通CamX架构对应Google原生Camera HAL3架构的标准API接口一级日志详细分析注释 【思维决定成长高度】当前讲述的是Camera领域log分析梯度分级讲解,讲究的是一种分析技巧,分析思维,一种感悟。技术路线的提升空间,需要更多开发技巧和开发学习能力去提升。技术大拿分析问题,可以从日志快速定位问题并解决问题,有充分的时间去学习更多知识,成长速度极快。同一起跑线,学习能力,开发效率等等都决定了程序员的成长提升空间。记得我毕业三年,同学之间的差距无限拉大,一些人还在几千块薪水,你已经是他的四五倍了,人与人的差距就是短短几年就拉开了。 阅读详情

相关推荐

3D点云处理:PointNet++与PointTransformer的对比

摘要: 3D点云处理中,PointNet++和PointTransformer是两种主流深度学习模型。PointNet++通过分层采样和分组策略提取局部特征,而PointTransformer利用自注意力机制捕捉全局上下文。实验表明,PointTransformer在分类(ModelNet40准确率92.1%)和分割(ShapeNet mIoU 85.7%)任务上性能更优,但计算开销较大(训练时间180秒/轮)。PointNet++在实时性场景更具优势(训练时间120秒/轮)。未来可结合两者优势,或优化Tr

shejizuopin的博客 1117

Codeforces-Round 394#A-Dasha and Stairs

A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On her way to programming school tiger

陈续缘的blog 408

Android投屏开发实战:手把手教你用Miracast实现Sink端功能(附完整代码)

本文是一份Android投屏Sink端开发的实战指南,详细讲解了如何利用Miracast协议和Wi-Fi P2P技术,从零构建一个功能完整的屏幕接收器。内容涵盖环境搭建、通过反射启用WFD Sink模式、RTSP协议协商、RTP流接收与解析,以及最终使用IjkPlayer进行音视频解码播放的全过程,并附有核心代码示例。

cherry的博客 878

Codeforces761A. Dasha and Stairs

A. Dasha and Stairs time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output On her way to programming school tiger Dasha faced her first test — a

845

记录LeNet的硬件加速器设计(一)

LeNet的硬件加速器设计实现。

2301_81029398的博客 3543

VisionPro开发实战:CogRecordDisplay控件显示与保存图片的完整流程(附C#代码示例)

本文详细解析了VisionPro开发中CogRecordDisplay控件的图像处理全流程,包括图像加载、显示优化、动态清屏及结果保存等关键操作。通过C#代码示例,展示了如何高效使用该控件进行工业视觉应用开发,特别适合自动化检测系统的开发者参考。

weixin_42523792的博客 274

codeforces 753 A. Dasha and Stairs

A. Dasha and Stairstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOn her way to programming school tiger Dasha faced her first test — a huge stair

Yishui_lovely 670

Zemax 中的 LED 阵列模型

这些光线是所有光线的子集,用于布局可视化,而不是详细分析。X 和 Y 散度(αx 和 αy)以度为单位,以不同的方式设置为 6 度和 12 度。每个 LED 都以朗伯模式(广角分布)发光,尽管有些 LED 具有内置光学元件,用于更窄或更聚焦的光束。,具体取决于这些类别中使用的半导体材料。LED 阵列由多个发光二极管 (LED) 组成,这些二极管以特定模式或配置排列,以实现均匀照明、更高强度或特定照明特性。如果数据的存在更改为“辐射强度”,则它以弧度为单位显示每个立体角的功率,作为探测器上入射角的函数。

jkh920184196的博客 1594

CF761 A. Dasha and Stairs (水题)

传送门 A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On her way to

blanKey的博客 832

Halcon VariableInspect (变量检查拓展)安装指南

网址2;

T 957

2024年全国青少年信息素养大赛复赛真题(算法创意实践挑战赛C++试卷:带解析)

2024年全国青少年信息素养大赛复赛真题(算法创意实践挑战赛C++试卷:带解析)

王老师青少年编程 4784

Codeforces Round #394 (Div. 2) A+B

A. Dasha and Stairstime limit per test:2 secondsmemory limit per test:256 megabytesinput:standard inputoutput:standard outputOn her way to programming school tiger Dasha faced her first test — a huge s

妍恐龙的博客....^~^眼熟我 436

[RK-Linux] 移植Linux-5.10到RK3399(十)| 配置AP6256模组使能WIFI、BT功能

[RK-Linux] 移植Linux-5.10到RK3399(十)| 配置AP6256模组使能WIFI、BT功能

Systemcall名屋 2978

C语言 问题: Dasha and Stairs

Dasha and Stairs   On her way to programming school tiger Dasha faced her first test — a huge staircase! The steps were numbered from one to infinity. As we know, tigers are very fond of all stri...

Move on 285

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

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

【codeforces 761A】Dasha and Stairs

time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output On her way to programming school tiger Dasha faced her first test — a huge s...

AWCXV 237

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

A. Dasha and Stairs

time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On her way to programming school tiger Dasha faced her first tes

无知的我 1471

温度PID控制PLC程序

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

Codeforces Round #394 (Div. 2)(A. Dasha and Stairs,B. Dasha and friends,C. Dasha and Password)

题目链接 因为技术问题,这round排名崩了不算分,那就先来更新ABC题吧A. Dasha and Stairs 很多人被hacked应该是没有考虑a、b同时为0的情况,我也没注意啊#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespa

永远保持谦卑好学 474

codeforces 761A Dasha and Stairs

点击打开链接 A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On her way to pro

zhang__liuchen的博客 327

Codeforces 761A-Dasha and Stairs

Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On her way to programming school tiger Das

wang_128的博客 625

CodeForces - 761A Dasha and Stairs

CodeForces - 761A Dasha and Stairs On her way to programming school tiger Dasha faced her first test — a huge staircase! The steps were numbered from one to infinity. As we know, tigers are very fond ...

mandiheyanyu的博客 138

Dasha and Stairs CodeForces - 761A

Dasha and Stairs 题目链接: CodeForces - 761A 题意:问能否找到一段连续整数, 使得偶数与奇数的个数与给出数据相同;只要两数差值&lt;=1即可;注意特...

Sirius_han的博客 297

761A Dasha and Stairs

A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On her way to programming school tiger Dasha fa...

weixin_30467087的博客 110

poj 761A Dasha and Stairs

链接:http://codeforces.com/problemset/problem/761/A A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outp

一七得七 269

Codeforces761A Dasha and Stairs

A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On her way to programming school tiger

Jelly_acm的博客 643

Codeforcrs 761 A Dasha and Stairs

On her way to programming school tiger Dasha faced her first test — a huge staircase! The steps were numbered from one to infinity. As we know, tigers are very fond of all striped things, it is

qq_37503046的博客 346
上一篇: POJ 2456 Aggressive cows 二分
下一篇: Dasha and Password (暴力+贪心)
Guuuuuu老师儿
博客等级 码龄9年 259粉丝 718原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值