codeforces 742B Arpa's obvious problem(水)

Vivado FPGA 工程模板:参数化消抖、PWM 与 XDC 约束 这份工程模板解决 FPGA 起步阶段的工程骨架与踩坑问题。含可综合的参数化按键消抖(两级同步消亚稳态)、参数化 PWM(0/满占空比边界修复)、顶层呼吸灯示例、XDC 时钟与 IO 约束模板、Tcl 一键建工程脚本。面向 STM32 开发者向 FPGA 扩展,换 Artix-7/Kintex/Zynq 只需改器件与引脚。 立即下载

点击打开链接

//题意:求ai^aj=x 的(i,j)&&i<j个数 
/两边同^ai   ->   aj=x^ai
枚举i用map统计aj=x^ai出现次数即可 

//坑点ans爆int
1e5 x=3
1 2 1 2.......答案约等于1/2(1e5*1e5)
统计出来的i<j个数若为k,i<j和i>j的个数一一对应,则i>j个数也为k

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath> 
#include <map>
using namespace std;
typedef long long ll;
const int N=1e5+20; 
int used[N];
int a[N];
map<int,int> mk;
int main()
{
	int n,x;
	cin>>n>>x;
	ll ans=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		mk[a[i]]++;
	}
	//题意:求ai^aj=x 的(i,j)&&i<j个数 
	//两边同^ai   ->   aj=x^ai
	//枚举i用map统计aj=x^ai出现次数即可 
	for(int i=1;i<=n;i++)
	{
		//aj=a[i]^x
		if(x==0)
		ans+=mk[a[i]^x]-1;
		else
		ans+=mk[a[i]^x];
	}
	cout<<ans/2<<endl; 
	return 0;
}


四旋翼无人机模糊自适应PID控制,俯仰姿态控制律设计研究(Matlab代码、Simulink仿真实现) 内容概要:本文围绕四旋翼无人机的俯仰姿态控制问题,深入研究了模糊自适应PID控制律的设计与实现。通过结合模糊逻辑系统的自适应能力与传统PID控制器的稳定性,构建了一种能够在复杂动态环境中有效应对外部扰动和模型不确定性的先进控制策略。研究详细阐述了控制系统的结构设计、模糊规则库的建立、隶属度函数的选取以及PID参数的在线调整机制,并利用Matlab/Simulink工具进行了完整的建模与仿真实验,验证了所提方法在响应速度、超调量和抗干扰能力等方面相较于传统PID控制的显著优越性。; 适合人群:具备自动控制理论基础和Matlab/Simulink仿真经验的自动化、航空航天及相关专业的本科生、研究生及科研人员。; 使用场景及目标:①学习和掌握模糊自适应PID控制器的设计原理与方法;②研究无人机姿态控制算法的性能提升途径;③完成相关课程设计、毕业设计或科研项目的仿真验证工作。; 阅读建议:建议读者结合Matlab代码与Simulink模型,深入理解控制算法的实现细节,并尝试调整系统参数和仿真条件,以探究不同因素对控制性能的影响,从而达到理论与实践相结合的学习目的。 立即下载

相关推荐

复现基于李雅普诺夫的多个欠驱动无人船协同路径跟踪Matlab仿真

内容概要:本文详细介绍了基于李雅普诺夫稳定性理论的多个欠驱动无人船协同路径跟踪控制方法的Matlab仿真研究。通过建立非线性动力学模型,设计分布式协同控制器,并利用李雅普诺夫函数严格证明系统的渐近稳定性,实现了多艘无人船在复杂海洋环境下的高精度路径跟踪与稳定编队保持。文中系统阐述了控制器的设计原理、稳定性分析过程、仿真参数配置及多种典型场景下的仿真实验结果,充分验证了该方法在提升编队协同性、抗外部干扰能力和鲁棒性方面的显著优势。; 适合人群:具备自动控制理论、非线性系统分析基础以及Matlab/Simulink仿真能力的研究生、科研人员,以及从事无人系统、船舶自动化、多智能体协同控制等领域研发工作的工程师。; 使用场景及目标:①用于多智能体系统协同控制算法的研究与教学示范;②为欠驱动船舶的路径跟踪控制、海上集群航行等实际工程应用提供可靠的算法设计思路与仿真验证平台;③支撑相关领域高水平论文撰写、科研项目申报与关键技术攻关。; 阅读建议:建议读者结合提供的Matlab代码逐模块研读,重点关注李雅普诺夫函数的构造技巧与控制器参数的整定方法,并尝试在不同环境扰动(如海流、风浪)下进行仿真实验,以深入理解系统的鲁棒性与适应性。

Codeforces 742B Arpa’s obvious problem and Mehrdad’s terrible solution(map水题)

Arpa’s obvious problem and Mehrdad’s terrible solution time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There

Chunzhen的博客 1255

无线通信工业级双频大功率无线AP基站:2.4G+5GHz全频段高带宽抗干扰设备在智慧物流与工业自动化场景中的应用

内容概要:斯普莱WiFiSupply WFS7000BDIAC是一款2.4G+5GHz双射频、支持1166Mbps无线速率的电信工业级室外型大功率无线AP基站,具备31dBm×2发射功率、IP68防护等级、-45~85℃宽温工作能力及20万小时MTBF认证,支持TDMA时分多址、AI智能FastRoaming极速漫游(≤30ms)、≤1ms通信延迟等核心技术,适用于复杂电磁环境与恶劣气候下的全天候运行。设备采用4T4R MIMO架构,支持多档频宽调节、链路聚合、高带机量及远距离覆盖(3km以上),选配高增益天线可实现150km以上桥接传输,广泛应用于智慧物流、工业4.0、AGV/AMR、驾考系统、森林防火、车载船载视频等场景。; 适合人群:从事工业无线网络设计、智能制造系统集成、智慧交通与物流信息化的工程技术人员及项目决策者;具备一定网络基础知识并负责无线覆盖方案选型、部署与运维的专业人员。; 使用场景及目标:①在大型仓库、四向穿梭车立体库、PLC产线等工业自动化场景中构建高稳定、低时延无线网络;②为AMR/AGV、堆垛机、无人机、教练车等移动设备提供无缝漫游与实时控制连接;③实现远距离无线桥接与视频回传,如森林防火监控、车载视频传输等;④满足极端环境下(高寒、高温、强电磁干扰)对网络可靠性与安全性的严苛需求; 阅读建议:此文档适用于方案设计前期选型参考,建议结合“产品参数”与“行业应用”章节进行组网模式匹配分析,并重点关注TDMA、FastRoaming、巨量安全隧道等专有技术在实际场景中的适配性,同时核实相关认证信息以确保合规部署。

Codeforecs 424C Magic Formulas 规律+前缀和

点击打开链接 ^异或符号  题意 给出n个数,n 异或满足交换律和消去率  i mod k (i=1,2...n)  = 1 ^2^3..^k-1^0 ^1^2^.....k-1^0,...  若有余数,r=n%k 总共有b=n/k+1组, 若组数为偶数,则前面每组两两异或为0 ,最后有余数一组的值为 1^2^3..^r 若组数为奇数 则前面每组两两异或为0,剩下1^...k-1 1

Masamiiiiii 1214

BODAS说明书的中文版与相关资料总结

花了三天时间配了控制器的接线口,找了软件安装的一套东西。 又花了一周时间零零散散在网上只找到关于控制器少得可怜的资料: 1.力士乐控制器RC6系列介绍 2.力士乐控制器手册不完整版 3.RC6-9程序下载 力士乐配套的只有德语和英语两版,人工翻译专业文件的价格太惊人,决定自己写一版方便大家。有不正之处欢迎指出。 For these controllers, in the event of an...

我的技术日常 6503

AI大模型学习(14)AI 小白入门!用 OpenCV+Python 打造人体姿态识别系统,超详细教程来了

这篇教程介绍了如何使用Python+OpenCV+MediaPipe搭建入门级人体姿态识别系统。主要内容包括:人体姿态识别的应用场景(如健身APP、体感游戏)、开发环境搭建(安装Python、OpenCV和MediaPipe库)、核心代码实现(通过30行代码完成摄像头姿态检测),以及进阶功能开发(深蹲动作纠正算法和PPT体感控制器)。教程详细解析了MediaPipe的BlazePose模型架构和33个关键点的生理学意义,并提供了多线程优化等性能提升方案。该项目适合AI初学者实践,无需复杂算法即可实现实时人体

isoft888的专栏,致力于C#/python分享物联网、大数据,神经网络的等领域,欢迎讨论交流! 1567

Atcoder ARC 71D 井井井 / ### 公式化简

点击打开链接 题意:给出m条平行于x轴的直线:yi ,n条平行于y轴的直线xi,n,m ans=segma(1~n)segma(1~m)(xj-xi)*(yl-yk) ans=segma(xj-xi)*segma(yl-yk) n #include using namespace std; typedef long long ll; const int N=2e5+20; const

Masamiiiiii 959

电池管理系统(BMS)系列—状态估计之SOH

BMS系列文章,介绍了SOH估计

zxx52113140的博客 1854

UVA 1262编码(第k字典序)

点击打开链接 我们先统计分别在每一列均在两个矩阵出现的字母,然后从小到大排好序。 对于第一个样例来说,我们得到ACDW、BOP、GMOX、AP、GSU 第一个字母无论以什么开头 后面都有3*4*2*3=72种可能 当k tot为后面的全排列 tot/=cnt[i] 则第i个字符因取第j个 j=k/tot (下取整,所以k-- 保证(72-1)/72 和(71-1)/72

Masamiiiiii 764

Modelsim 安装步骤详解

Modelsim 安装步骤详解目录一、modelsim简述及下载1、简介及特点2、modelsim版本3、modelsim下载二、安装步骤详解三、注册简述四、总结与参考资料1、总结2、参考资料 目录 本篇文章主要对Modelsim SE版本安装步骤的介绍。 一、modelsim简述及下载 1、简介及特点 简介 modelsim是Mentor公司开发的优秀的HDL语言仿真软件。 它能提供友好的仿真环境,采用单内核支持VHDL和Verilog混合仿真的仿真器。它采用直接优化的编译技术、Tcl/Tk技术和单

执迷不悟 15万+

【驭风计划 算法训练营】周测4:习题11-4、8-4、12-4

给出 nn 个非负整数 x1,x2,⋯,xnx1,x2,⋯,xn,有 qq 个询问,第 jj 个询问给出一个非负整数 yjyj,求其中,xor 表示按位异或运算。

Mege1的博客 1046

codeforces 727A 规律

点击打开链接 两个操作 x*2  , x*10+1  (用bfs搜TLE了)发现经过操作1后的数为偶数 经过操作2后为奇数->合法操作只有一种 所以最后的b如果为 偶数 则可以推出是由操作1得来 将b/2继续迭代 奇数 则由操作2的来 将b=(b-1)/10后继续迭代 ,可以发现如果 (b-1)%10!=0 则没有x*10+1=b 退出即可 #include #include #in

Masamiiiiii 760

黑猫带你学eMMC协议第33篇:eMMC CQE功能介绍——一种模仿UFS命令队列的发送机制

本文详细介绍了eMMC协议中的Command Queuing Engine (CQE)及其相关功能。CQE是eMMC 5.1版本引入的新特性,旨在通过硬件处理命令队列,简化软件代码的编写。文章首先介绍了CQE的基本概念,包括其与Host Controller Interface (HCI)的区别,以及CQE如何通过Task Descriptor List (TDL)管理任务。接着,文章详细描述了CQE如何发送命令和数据给eMMC,并解释了Task Descriptor和Transfer Descriptor

黑猫奥利奥的博客 990

Codeforces 355C Vasya and Robot 暴力枚举

点击打开链接 题意:给出n个物品重量wi,n 如果用的手和上一次相同 则加上对应的Q1或者Q2,求取走n物品的最小消耗  由于每次只能从端点拿 若左手拿x次则会拿走前x个,右手会拿走后n-x个,交替使用后,在加上abs(x-(n-x))*(Q1 or Q2) 保存前缀和,暴力枚举即可 #include using namespace std; typedef long long

Masamiiiiii 753

YOLOv8【第一章:基础入门篇·第1节】一文搞定,核心架构深度解析与环境配置!

🏆 本文收录于 《YOLOv8实战:从入门到深度优化》 专栏,该专栏专注于分享我在YOLOv8目标检测模型中的实战经验,涵盖从入门基础到深度优化的全方位解决方案。无论你是计算机视觉的新手,还是具有多年深度学习经验的专家,本专栏都将为你提供高效、可复现的技术方案,助你掌握YOLOv8的核心技术,提升目标检测性能,突破瓶颈,优化模型,并加速项目开发🚀!

**My Coding Family** 2112

LLaMA-Factory微调教程5:多模态VLM模型对话

视觉-语言模型(VLM)概述与应用 视觉-语言模型(VLM)是一类结合视觉和语言信息的人工智能模型,旨在实现跨模态的理解与交互。其核心目标包括跨模态理解和生成能力,关键技术涉及模态表示与映射、多模态预训练以及跨模态交互机制。 典型VLM模型包括: CLIP:通过对比学习实现图像和文本的向量空间对齐 BLIP:结合自监督和弱监督学习提升语义对齐 ALBEF:基于BERT结构扩展跨模态注意力 DALL-E系列:基于文本生成图像的生成式模型 CLIP4Clip:扩展CLIP到视频领域 VLM在图像/视频检索、视觉

Cachel Wood的博客 1117

Codeforces 810C Do you want a date 枚举

点击打开链接 题意: n个数,n //sort后 枚举最小值为i,则ans+=(a[j]-a[i])*2^(j-i-1) (j=i+1~n)  //化解:一个数a[i]总共减了:a[i]*(2^0~2^(n-i-1)) 加了a[i]*(2^0+~2^(i-2))  #include using namespace std; typedef long long ll; con

Masamiiiiii 699

深度学习工具包 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 745B HongCow and puzzles 矩形(水)

点击打开链接 //题意:'X'是拼图碎片 问给出两块G(不能旋转) 能否拼出矩形 // 反过来看 就是把一个矩形切成两块,则每一块仍然是矩形,判断G中的'X'能否组成矩形  //确定矩形边界后求出面积与个数比较即可 #include using namespace std; typedef long long ll; typedef pair P; const int inf=1

Masamiiiiii 697

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

Codeforces 723C暴力(最小值最大)

点击打开链接 #include #include #include #include #include #include #include #define M 2016 using namespace std; const int inf=1<<20; int a[M],b[M];//b[j] the num of songs the groups j plays map

Masamiiiiii 672

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

Codeforces 791 B Bear and Friendship Condition 规律

点击打开链接 题意:n个点,m条边,n,m 观察得到 同一个连通分量内,因为u,x联通,若长度为l 则u->长度2,3..l都必须有直接相连的边,所以任意两点都必须存在直接相连的边, dfs求出每个连通分量的点数n,合法的图边数要求边=C(n,2)  #include using namespace std; typedef long long ll; const int N=5e5

Masamiiiiii 608

FJNU 1195 捧杯 向量(受力分析模拟)

点击打开链接 #include #include #include #include #include using namespace std; typedef long long ll; const int N=1e5+20; const ll mod=400; int gcd(int a,int b) { if(a%b==0) return b; else return

Masamiiiiii 605

AGC 013 B Hamiltonish Path 模拟(deque)

点击打开链接 题意:n 任意两个相邻点作为endpoint,并放入双端队列中,遍历u的相邻点,若存在v没被访问,则令v为起点 继续模拟 因为一定有解,复杂度为O(M)  #include using namespace std; const int N=2e5+20; int n,m; vector e[N]; int q[N],f,r; //deque,保存起点和终点 int vi

Masamiiiiii 578

nyoj 187 素数快速筛法

http://acm.nyist.net/JudgeOnline/problem.php?pid=187 #include #include #include #include long const M=2000010; long a[M],p; int main() { long i,j,x,y,k,q1,q2; int t,n; memset(a,1,sizeof(a));

Masamiiiiii 574

hdu 5944 Fxx and String 暴力(水)

点击打开链接 题意:给定一个字符串s,求有多少个三元组(i,j,k)满足i,j,k是等比数列且s[i]=='y'&&s[j]=='r'&&s[k]=='x'。 注意点:公比可能小于1 #include #include #include #include #include #include #include #include using namespace std;

Masamiiiiii 559

Codeforces 805D Minimum number of stpes 规律

点击打开链接 题意:给出string 只包含字符'a','b',长度 简单观察  若有abbb ->bbabb bbbbbba a后面有多少个b该'ab'就变化多少次,并且b的个数增加为原先两倍. 从后往前 碰到b累加,碰到a更新答案并把b的数量翻倍  #include using namespace std; typedef long long ll; const int N=

Masamiiiiii 530

nyoj 45棋盘覆盖

http://acm.nyist.net/JudgeOnline/problem.php?pid=45 #include #include __int64 f[110];//记录 2^i*2^i所需要的方格数 int index,a[110],b=4; //f[i]=4f[i-1]+1; 划分四个区域 在中间填一个 则每个小区域为f[i-1] //

Masamiiiiii 521
上一篇: poj 2570 Fiber Network Floyd思想+二进制处理
下一篇: Codeforces 742C Arpa's loud Owf 思维
Masamiiiii
博客等级 码龄11年 32粉丝 625原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值