codeforces-A. Equation

MS1861宏晶微视频显示与控制器芯片:开发资料全解析与应用指南 本文全面解析了宏晶微MS1861视频显示与控制器芯片的核心功能与开发流程。该芯片作为高性能的“视频信号翻译官”,支持HDMI、LVDS等多种输入与MIPI、LVDS等输出,集成强大的图像处理与OSD叠加功能。文章详细介绍了从资料获取、环境搭建到以HDMI转MIPI为例的实战配置与调试技巧,为工业HMI、广告机等应用的开发者提供了完整的应用指南。 阅读详情
Let's call a positive integer composite if it has at least one divisor other than 1 and itself. For example:

the following numbers are composite: 1024, 4, 6, 9;
the following numbers are not composite: 13, 1, 2, 3, 37.
You are given a positive integer n. Find two composite integers a,b such that a−b=n.

It can be proven that solution always exists.

Input
The input contains one integer n (1≤n≤107): the given integer.

Output
Print two composite integers a,b (2≤a,b≤109,a−b=n).

It can be proven, that solution always exists.

If there are several possible solutions, you can print any.

Examples
inputCopy
1
outputCopy
9 8
inputCopy
512
outputCopy
4608 4096
#include<iostream>
#include<math.h>
#include<stdio.h>
using namespace std;
typedef long long ll;
const ll maxv=1e7+10; 
ll is_prime[maxv];
void sieve(ll n){
    //ll t=0;
    for(ll i=0;i<=n;i++){//将初值均赋值为true
        is_prime[i]=true;
    }
    for(ll i=2;i<=n;i++){
        if(is_prime[i]){
            //t++;
            for(ll j=2*i;j<=n;j+=i){
                is_prime[j]=false;
            }
        }
    }
	//cout<<t<<endl; 
}
int main(){
	sieve(maxv);
	ll n=0;
	cin>>n;
	ll a=0;
	for(ll b=1;b<=1e7;b++){
		a=b+n;
		if(!is_prime[a] && !is_prime[b]){
			cout<<a<<" "<<b;
			break;
		}
	}
	return 0;
}

 

MicroBlaze系列教程(5):AXI_UART16550的使用 axi-uart16550是Xilinx的一款串口IP核,支持配置成16450或16550模式,16550和16450是指的早期电脑主板上的串口芯片型号,16550相比于16450多了FIFO,现在已经很少使用。相比于,16550支持1或2位停止位,包括uartlite所有的功能,而且支持在SDK中灵活对波特率、数据、校验方式进行配置。与uartlite不同的是,不能单独指定发送中断和接收中断函数,只有一个中断函数,通过event参数来区分当前是发送或接收中断。 阅读详情

相关推荐

华为[ENSP]OSPF的配置实例(单区域+多区域)

华为[ENSP]OSPF的配置实例(单区域+多区域)

weixin_62594100的博客 2万+

HDU - 6182 A Math Problem (打表)

题目链接http://acm.hdu.edu.cn/showproblem.php?pid=6182 题目 You are given a positive integer n, please count how many positive integers k satisfykk≤nkk≤n. Input There are no more than 50 test cases....

Viator 378

帕德伯恩大学轴承数据集(PU)介绍

PU数据集介绍一、帕德伯恩大学轴承数据集故障类别说明二、关于损伤描述2.1 损伤组合:2.2 重复和多重损伤的安排:2.3 几何尺寸2.4 损伤程度2.5损伤特征数据集损伤类别三、人为损坏轴承3.1 最常用的人为损伤制造方法是:3.2 本数据集使用的人工损坏是由三种不同方法引起的四、通过加速寿命试验产生真正的轴承损坏样本 一、帕德伯恩大学轴承数据集 数据集下载地址 从帕德伯恩大学获得的PU数据集是一个6203轴承数据集,包括人为诱发的和真实的损害。采用压电加速度计采集轴承座的振动信号,采样频率为64 kHz

m0_47180208的博客 3万+

Break Number --AtCoder

题目描述 Takahashi loves numbers divisible by 2.You are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. T...

weixin_30500663的博客 299

SAP VC实战:用CU01和CS02搞定BOM里的‘智能’对象相关性(附语法避坑指南)

在工业制造领域,产品配置的复杂性往往超出想象。想象一下,当客户需要定制一台工业设备时,可能有数百种配置选项相互影响——从基础材质到动力系统,从控制模块到安全装置。如何在SAP系统中优雅地管理这种复杂性?对象相关性(Object Dependencies)就是解决这一挑战的利器。

weixin_42524824的博客 467

图解转置卷积原理

声明:本文大部分搬运自【机器学习】详解 转置卷积 (Transpose Convolution) 感谢博主花与人间事同,本人只是在博主原创文章上做补充以及添加一些自己的理解。 1 转置卷积的背景 通常,对图像进行多次卷积运算后,特征图的尺寸会不断缩小。而对于某些特定任务 (如图像分割和图像生成等),需将图像恢复到原尺寸再操作。这个将图像由小分辨率映射到大分辨率的尺寸恢复操作,称为上采样 (Upsample),如下图所示: 上采样方法有很多,详见【图像处理】详解 最近邻插值、线性插值、双线性插值、双三次插值

laonafahaodange的博客 5685

python答案错误_错误答案Python3.6

You are given a set S and Q queries. Initially, S is empty. In each query:You are given a positive integer X.You should insert X into S.For each y∈S before this query such that y≠X, you should also in...

weixin_34333092的博客 354

手把手教你学Simulink——基于Simulink的全双工无线通信仿真建模示例

目录手把手教你学Simulink——基于Simulink的全双工无线通信仿真建模示例一、背景介绍二、所需工具和环境三、步骤详解步骤1:创建Simulink模型步骤2:设计输入信号步骤3:添加调制模块步骤4:添加自干扰消除模块步骤5:添加AWGN信道步骤6:添加接收端处理步骤7:添加解调模块步骤8:计算误码率(BER)步骤9:添加显示模块步骤10:设置仿真参数步骤11:运行仿真并分析结果四、总结 全双工(Full-Duplex)无线通信技术允许在同一频段上同时进行数据的发送和接收,这与传统的半双工(Half-

MHD0815的博客 182

CodeForces 1060 B Maximum Sum of Digits

Maximum Sum of Digits   You are given a positive integer n.   Let S(x)S(x) be sum of digits in base 10 representation of xx , for example, S(123)=1+2+3=6S(123)=1+2+3=6 , S(0)=0S(0)=0 .   Your ...

dbt3498的博客 242

X线DR医学图像 --- DR医用滤线栅及摩尔纹详解 (二) 摩尔纹的产生机理

1,横向摩尔纹的表现 2,纵向摩尔纹的表现 3,摩尔纹在pitch = 143μm(注:pitch为采样间隔/周期)的FPD上的表现。 4,摩尔纹的危害(严重的影响了临床诊断) 5,摩尔纹对胸片肺部肺纹理的破坏 6,滤线栅的频率(滤线栅生产厂家的产品参数)。判断摩尔纹产生的重要依据之一 7,DR平板探测器的采样频率/空间极限分辨率 l.........

松下J27录放机 4981

OData Request:Create Entity 在 ABAP OData Client Proxy 中的工程化实践

文章摘要 本文针对具备 SAP Gateway 与 ABAP 开发经验的读者,详细讲解如何通过 ABAP OData Client Proxy 实现 OData 服务的 Create 操作。首先对比了 OData V2 与 V4 的 Create 规范差异,强调键、集合 URL 和请求体的标准化要求。随后介绍了 ABAP Client Proxy 的编程模型,包括 Client Proxy、Entity List Resource 和 Create Request/Response 三个核心对象,并提供了完

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

A Math Problem HDU 6182

A Math ProblemYou are given a positive integer n, please count how many positive integers k satisfy kk≤nkk≤n. Input There are no more than 50 test cases. Each case only contains a ...

Adolphrocs的博客 452

RK3588部署YOLO模型 包含模型量化+npu轻量化+ubuntu+RGA图像加速和多线程模型加速 包源码

本专栏为深度学习部署全栈学习体系,包含68篇由浅入深的教程,专为零基础学习者设计。内容涵盖TensorRT与RK3588平台部署技术,包含Jetson系列和RK系列硬件部署实战,采用"理论+源码+实战"三位一体的教学模式。学习路径从基础环境搭建到模型优化、容器化部署、多硬件平台适配,最终掌握工业级AI部署能力。特色包括C++基础教学、Docker容器化、INT8量化、多线程优化等核心技术,并附带YOLOv5、人脸检测、车牌识别等多个实战项目源码。适合算法工程师转部署方向、嵌入式开发者及对

FJN110的博客 3731

[codeforces 1269A] Equation 模拟

[codeforces 1269A] Equation 模拟 总目录详见https://blog.csdn.net/mrcrack/article/details/103564004 在线测评地址https://codeforces.com/contest/1269/problem/A Problem Lang Verdict Time Memory A - Eq...

mrcrack的博客 310

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

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

CodeForces 627A XOR Equation

K - XOR Equation Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 627A Appoint description:  System Crawler  (Aug 4, 2016 12:

Calm微笑 851

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

Codeforces 627A XOR Equation 【数学】

A. XOR Equation time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Two positive integers a and b have a sum

世界很大 1473

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

A. Equation CodeForces - 1269A

一、内容 Let's call a positive integer composite if it has at least one divisor other than 1and itself. For example: the following numbers are composite: 1024, 4, 6, 9;the following numbers are not compo...

Tizzi的博客 905

CodeForces 627A XOR Equation(异或)

http://codeforces.com/problemset/problem/627/A A. XOR Equation time limit per test 2 seconds memory limit per test 256 megabytes input standard input output st

Shyazhut 453

A. Exponential Equation codeforces 1787A

思路:可以发现,当x=1时,原式变为2*y=n,所以当n是偶数时,1,n/2即为答案,当n是奇数时,若x,y一奇一偶,都是偶数,矛盾,若都为偶数,同样得出来的是偶数,矛盾,若都为奇数,题目大意:给出一整数n,求两非零正整数x,y使。都为奇数,相加为偶数,矛盾,所以n是奇数时无解。

ashbringer233的博客 431

Codeforces 627A XOR Equation【位运算实现加法】

A. XOR Equation time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Two positive integers a and b have a sum

DTL66的博客 920

codeforces 627 A. XOR Equation(位运算,结论)

http://codeforces.com/contest/627/problem/A 题意: 两个数a,b a+b=s a xor b= x 给出s,x 问有多少对a,b满足条件 首先有个结论,(其实自己也能推出来,但自己太菜没想出来) 拥有这个公式后,这道题变得简单了些,移项后求出 a&b = (s - x) / 2,并且判断是否合法 a ^ b 我们已经知道,那么只需要通过a&...

- 回忆゛ 270

Codeforces 627A XOR Equation

XOR Equation Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Description Two positive integers a and b have a sum of s and a bitwise XOR

z2664836046的博客 418

♥codeforces 627A-XOR Equation【数学】

Two positive integers a and b have a sum of s and a bitwise XOR of x. How many possible values are there for the ordered pair (a, b)?

小I的博客 1117

【CodeForces 627A】XOR Equation(位运算)

  A. XOR Equation time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Two positive integers a and b hav

FSMM_blog 504

Codeforces 627 A. XOR Equation (数学)

题目链接:http://codeforces.com/problemset/problem/627/A 题意: 告诉你s 和 x,a + b = s a xor b = x a, b > 0。 让你求符合条件的a b有多少对 思路: a + b = s , a ^ b = x ==> s - x = (a & b) * ...

weixin_30437481的博客 90

Codeforces 627A XOR Equation(思路)

题目大概说两个正整数a、b,已知s=a+b以及x=a xor b的值,问有几种a、b这样的数对。 我知道异或相当于无进位的加法,s-x就是其各个位置的进位,比如s-x=1010,那就表示a和b的第1位和第3位发生的进位。 这样,对于某些位其值就能确定,对于有些位其值不能确定(该位xor和为1且没有发生进位),这时a和b的该位都能选择0或者1,对于不确定的就是乘法原理答案累乘2。 ...

dengliugong3918的博客 299
上一篇: 子集和问题-dfs回溯法
下一篇: 1.Java基础-注解
ଳxin
博客等级 码龄8年 83粉丝 197原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值