How many

Arthas实战(3)- CPU使用率高问题排查 阅读详情

题目描述:

Give you n ( n < 10000) necklaces ,the length of necklace will not large than 100,tell me
How many kinds of necklaces total have.(if two necklaces can equal by rotating ,we say the two necklaces are some).
For example 0110 express a necklace, you can rotate it. 0110 -> 1100 -> 1001 -> 0011->0110.

输入:

The input contains multiple test cases.
Each test case include: first one integers n. (2<=n<=10000)
Next n lines follow. Each line has a equal length character string. (string only include ‘0’,‘1’).

输出:

For each test case output a integer , how many different necklaces.

样例输入:

4
0110
1100
1001
0011
4
1010
0101
1000
0001

样例输出:

1
2

code:

给出n个01字符串表示链,如果两个01字符串可以通过旋转得到就说这两个串是同一个,最后求有多少个不同的链。

解题思路:用最小表示法

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<set>
using namespace std;
char a[100050];
char b[100050];
set<string> jiang;
void findd()
{
	int n=strlen(a);
	int i=0,j=1,k=0;
	while(i<n&&j<n&&k<n)
	{
		int tot=a[(i+k)%n]-a[(j+k)%n];
		if(tot==0)k++;
		else
		{
			if(tot>0)
			{
				i+=k+1;
			} 
			else j+=k+1;
			if(i==j)j++;
			k=0;
		}
	}
	int tt;
	if(i>j)tt=j;
	else tt=i;
	for(int i=0;i<n;i++)
	{
		b[i]=a[(tt+i)%n];
	}
	b[n]='\0';
	jiang.insert(b);
}
int main()
{
	int n;
	while(~scanf("%d",&n))
	{
		for(int i=0;i<n;i++)
		{
			scanf("%s",a);
			findd();
		}
		printf("%d\n",jiang.size());
		jiang.clear();
	}
	return 0;
}
【OpenClaw从入门到精通】第45篇:Skill供应链安全——如何识别并避开恶意技能插件?(2026实测版) 随着OpenClaw生态爆发式增长,全球Skills总量近75万个,日均新增2.1万个,但恶意/问题插件已超600个,数十万用户受影响。本文基于奇安信威胁报告及360安全实践,拆解恶意技能的五大核心特征,提出"安装前三步法"安全审查流程,详解安全技能来源白名单与定期审计方案,并深度解析360龙虾Skill安全超市的分级认证机制。读者可掌握从技能筛选、安装审查到术后审计的全流程安全防护手段,通过实操命令与案例演示,零成本构建Skill供应链安全防线,避免遭遇私钥窃取、资产损失等安全事件。 阅读详情

相关推荐

USB-Type-C PCB布局布线设计规范

USB Type-C连接器有24个引脚。图1和图2分别显示了USB Type-C插座和插头的插针。母头/母座公头/插头可以很明显看出,插口内的Pin功能相对于中心对称。公头插入母头,无论正反插,引脚功能都完美契合。而且电源VBUS/GND都拥有4个Pin,最大支持5A电流,在保证高速数据传输的同时也提高了电流承载能力。表 1 和表 2 分别汇总了在 USB Type-C 型插座和插头上所使用的信号列表。

weixin_63005522的博客 8279

how many tables(并查集模板)

  题意:有一群小朋友要吃饭,认识或者间接认识的人才可以做到一张桌子(每张桌子可以座无限多的人)上, 输入n个人和m组关系,问最少需要多少张桌子? #include&lt;bits/stdc++.h&gt; using namespace std; const int MAXN=1005; int n,m,f[MAXN]; void init() { for(int i=0;...

li_miaomiao的博客 302

微处理器实验报告-实验四

实验四 可编程定时/计数器8253实验 一、实验要求 利用8086外接8253可编程定时/计数器,可以实现方波的产生。 二、实验目的 1、学习8086与8253的连接方法。 2、学习8253的控制方法。 3、掌握8253定时器/计数器的工作方式和编程原理

青竹小轩的博客 5112

C++:HDU1213 How Many Tables

Problem DescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends...

qq_40907345的博客 384

WPF实现圆形菜单动态展开折叠效果

实现效果如下: 思路:根据子菜单个数计算旋转角度动态生成子菜单,并设置展开折叠动画。 步骤: 1、自定义按钮MyButton,建立展示图像属性DisplayImage public class MyButton : Button { public static readonly DependencyProperty DisplayImageProperty = DependencyProperty.Register("DisplayImage", typeof(

dnazhd的博客 3150

RK3588开发笔记-Buildroot编译Qt5WebEngine-5.15.10

Rockchip RK3588是一款强大的多核处理器,广泛应用于边缘计算、人工智能、嵌入式系统等领域。为了在RK3588上运行自定义的Linux系统,并使用Qt5WebEngine进行Web内容渲染,Buildroot是一个非常合适的工具。本文将详细介绍如何使用Buildroot编译并配置Qt5WebEngine-5.15.10。Qt5WebEngine是Qt框架中的一个模块,它提供了一个功能强大的Web浏览器引擎,允许开发者在Qt应用程序中嵌入和显示现代网页内容。

flypig has a dream! 1158

How Many Tables

Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a

w865629524的博客 2348

Altium Designer(AD)PCB拼版——两种方法教程

本文详细介绍了PCB拼版的设计要点与操作方法。主要内容包括:拼版目的(解决小尺寸夹持问题、提高利用率、降低成本)和三大连接方式(V-CUT、邮票孔、空心连接条)的特点与参数设置;工艺边设计规范(宽度、定位孔、Mark点等要求);拼版尺寸限制与常见错误检查;以及两种具体拼版操作方法(特殊粘贴和拼版阵列),并附有工艺边、定位孔、Mark点的绘制步骤示意图。同时提供了硬件工程师笔试面试相关资源链接。全文系统阐述了PCB拼版的核心技术和操作流程,为电子设计人员提供了实用指导。

XU157303764的博客 7602

How many(字符串最小表示法)

How manyTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3451    Accepted Submission(s): 1542Problem DescriptionGive you n ( n &lt; 10000) neckla...

穆梓先生 382

[网络安全提高篇] 一二〇.恶意软件动态分析经典沙箱Cape批量提取动态API特征

这是作者网络安全自学教程系列,主要是关于安全工具和实践操作的在线笔记,特分享出来与博友们学习,希望您喜欢,一起进步。前文详细介绍动态分析沙箱Cape的安装过程,其是一个开源的自动恶意软件分析系统,通过自动运行和分析恶意软件,全面分析和提取恶意软件的关键特征。然而,当样本数量增加时,单个样本分析会降低效率。这篇文章将讲解如何实现Cape沙箱的批量分析,通过调用Python脚本文件来实施批量处理,并将分析结果存储在指定位置,最后补充submit.py的参数及Python调用方式。基础性文章,希望对您有帮助!

杨秀璋的专栏 4121

全面解析智能座舱芯片参数:高通 (SA8295)vs 联发科,真实案例一行行讲给你听!

使用场景推荐芯片中低端车型 + 1屏导航语音SA8155P / MT8628(性价比高)中控+副驾+仪表+全景影像SA8255P / MT8678(性能强)高阶自动驾驶+域控融合SA8295P(顶级安全+算力)

weixin_43199439的博客 2079

How many(串的最小表示法)

Problem Description Give you n ( n < 10000) necklaces ,the length of necklace will not large than 100,tell me How many kinds of necklaces total have.(if two necklaces can equal by rotating ,we say ...

G191018的博客 473

基于DPCNN实现电商情感分析任务

下载链接项目中使用的模型是DPCNN,在模型中我们定义了三个组件,分别是embedding层,卷积层和全连接层。Embedding层:将每个词生成对应的嵌入向量,就是利用一个连续型向量来表示每个词卷积层:提取语句中的语义信息Linear层:将结果映射成2大小用于二分类,即正反面的概率。

优快云 精品推荐 1629

uva 11038 - How Many O's?(计数问题)

题目链接:uva 11038 - How Many O's? 题目大意:写出m到n之间的数,问需要写多少个0. 解题思路:f(x)表示从0到x需要写多少个0,于是给出区间[m,n]就有答案等于f(n)-f(m-1)。剩下的就是f(x)该如何求。枚举每个位置上可能为0的情况,这样就将这个数分成两个部分,在保证组成的数小于x的前提下,计算可以的组成方法。 例:x=12345,枚举十位为0

不慌不忙、不急不躁 2381

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

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

hdu 1213 How Many Tables

How Many Tableshttp://acm.hdu.edu.cn/showproblem.php?pid=1213 Problem DescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many t...

weixin_30384031的博客 105

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

How many的用法

How many 问多少,       可数名词复数紧跟着。       一般疑问句随其后,       其它成分不要丢。       举个例子来说明:       How many days are there in a week?  ***********************************************************1. What animals do

Mike.Fang 的专栏 4804

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

codeforces 9D How many trees?

题目连接:http://codeforces.com/problemset/problem/9/D D. How many trees? time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output In one very o...

CharllotteQZY的博客 318

hdu1213-How Many Tables(并查集)

并查集最基本的一道题。 How Many Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 53136 Accepted Submission(s): 26397 Problem Description Today is...

小麦面包 428

UVa 10790 How Many Points of Intersection?

/* coder: ACboy date: 2010-3-4 result: AC description: UVa 10790 How Many Points of Intersection?*/#include using namespace std;int main(){ long long a, b; int count = 0; l

个人独立博客http://www.acb0y.cn/ 861

寒假私训 —— 并查集 E - How Many Tables

E - How Many Tables 题目要求 Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the...

atnanajiang的博客 270

uva 10518 - How Many Calls?(矩阵快速幂)

题目链接:uva 10518 - How Many Calls? 公式f(n) = 2 * F(n) - 1, F(n)用矩阵快速幂求。 #include #include long long n; int b; struct state { int s[2][2]; state(int a = 0, int b = 0, int c = 0, int d = 0

不慌不忙、不急不躁 2003

UVA How many zeros and how many digits?

Problem G How many zeros and how many digits? Input: standard input Output: standard output Given a decimal integer number you will have to find out how many trailing zeros will be there in its

叶孤心的专栏 893

How many zeros and how many digits?

How many zeros and how many digits? Input: standard input Output: standard output Given a decimal integer number you will have to find out how many trailing zeros will be there in its factorial i

u012870383的专栏 845

OFA VQA模型入门必看:英文疑问词(What/How/Is/How many)效果对比

本文介绍了如何在星图GPU平台上自动化部署OFA视觉问答(VQA)模型镜像,并对比了不同英文疑问词(What/How/Is/How many)在该模型上的效果差异。通过该镜像,用户可以快速搭建视觉问答环境,实现让AI理解图片内容并回答问题的核心应用,例如识别图片中的物体及其属性。

weixin_42113456的博客 316

UVa 10213 How Many Pieces of Land ?

欧拉公式V−E+F=2

QWsin的博客 1314
上一篇: String Problem kmp+最大最小表示法
下一篇: Palindrome
大橘为重eleven
博客等级 码龄8年 35粉丝 103原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值