Codeforces Round #315 (Div. 2)

零售-公司间关联交易退货STO的实现方式 零售-公司间关联交易采购 STO-退货 集团公司下经常会出现一家公司和另外一家公司的公司间的关联交易,如跨公司销售、总分公司之间采购,分公司之间的采购等业务;通常公司间采购会采取STO的模式来实现(根据业务模式可以将库存转储统一做成STO的模式,公司间STO、同公司工厂间、同工厂库存地点间 的STO SAP都是支持的); 公司间STO 正向A向B采购都很熟悉,公司间退货STO的其实也是比较普遍的业务现象,很多实施着也将其做成反向的STO(B向A采购),而不是退货STO(A向B,item 选择return的标 阅读详情

A. Music

B. Inventory

C. Primes or Palindromes?


/**
A. Music 
*/
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define maxn 100005
using namespace std;
int main(){
    int n,m,q;
    while(cin>>n>>m>>q){
        int ans=0;
        while(m<n){
            m+=(q-1)*m;
            ans++;
        }
        printf("%d\n",ans);
    }
    return 0;
}

/**
B. Inventory
*/
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define maxn 100005
using namespace std;
int a[maxn];
int ans[maxn];
bool b[maxn];
int main(){
    int n;
    while(~scanf("%d",&n)){
        memset(b,0,sizeof(b));
        memset(ans,0,sizeof(ans));
        for(int i=0;i<n;i++){
            scanf("%d",&a[i]);
            if(!b[a[i]]&&a[i]<=n)
                ans[i]=a[i];
            b[a[i]]=true;
        }
        int A=1;
        for(int i=0;i<n;i++){
            if(ans[i]) continue;
            while(b[A]) A++;
            ans[i]=A++;
        }
        for(int i=0;i<n;i++){
            if(i==0) printf("%d",ans[i]);
            else printf(" %d",ans[i]);
        }
        printf("\n");
    }
    return 0;
}

</pre><pre name="code" class="cpp">/**
C. Primes or Palindromes?
*/

#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define maxn 1200005
#define ret 1.0*pr[i]/pa[i]
using namespace std;
int a[10];
bool check(int num){//判断回文数
    int A=0;
    while(num){
        a[A++]=num%10;
        num/=10;
    }
    for(int i=0;i<A/2;i++)
        if(a[i]!=a[A-i-1]) return false;
    return true;
}
int pa[maxn]={0};
int pr[maxn]={0};
bool b[maxn]={0};
void Init(){
    for(int i=2;i*i<=maxn-5;i++){
        if(!b[i]);
        for(int j=i+i;j<=maxn-5;j+=i)
            b[j]=true;
    }
    pa[1]=1;
    for(int i=2;i<=maxn-5;i++){
        pa[i]=pa[i-1]+check(i);
        pr[i]=pr[i-1]+(!b[i]);
    }
}
int main(){
    Init();
    double p,q;
    while(cin>>p>>q){
        p/=q;
        int ans=1;
        for(int i=2;i<=maxn-5;i++)//暴力求解
            if(ret<=p) ans=i;
        printf("%d\n",ans);
    }
    return 0;
}



 

红队内网攻防渗透:内网渗透之内网对抗:实战项目&VPC1打靶&PHP-RCE&三层代理路由&防火墙上线&密码喷射&域控提权 上面已经抓取到了密码,但是我们通过拓扑分析看,要想上线win10只能通过正向shell,因为win7的防火墙是开的,win10反向主动连接肯定入站规则拦截,而win10自己没有开防火墙,所以win7主动正向连接就可以上线。win7开启了防火墙,入站规则肯定是会拦截我们的请求的,所以我们需要反向上线,让win7主动来连接我们。这里扫描发现是存在ms17010漏洞的,但是想上线192.168.2.142的话,我们没有路由是上线不了的,这里有两种办法:一种msf直接生成后门,另一种cs移植后门到msf。 阅读详情

相关推荐

EtherCAT主站开发(学习笔记一)

摘要:本文介绍了基于STM32H7的EtherCAT主站开发探索。EtherCAT是一种高实时性工业以太网协议,具有低延迟、高带宽利用率等特点。文章详细解析了EtherCAT的协议架构、帧结构和工作原理,重点阐述了PDO数据传输过程及主从站通信机制。同时介绍了CoE、FoE等应用层协议扩展。作者将基于SOEM开源协议栈进行开发,为后续实际应用中的伺服电机控制奠定基础。

weixin_69388007的博客 1473

Codeforces Round #315 (Div. 2) A

Codeforces Round #315 (Div. 2)                A.   http://codeforces.com/contest/569/problem/A A题意不好理解,q-1/q是下载歌曲的速率,设t秒后听歌进度和下载进度相同,则有 t*(q-1)/q+s=t,解得t=s*q; ,然后重新开始,设 t1秒后听歌进度和下载进度再次相同,则有 t1*(

Olga_jing的博客 425

python blp模型 估计_随机系数Logit模型及Stata实现

欢迎投稿(荐稿)计量经济圈,计量相关都行邮箱:econometrics666@sina.cn作者:北京交通大学经济管理学院博士生,王琦珀。欢迎你加入计量经济圈社群,一起探讨前沿计量理论和实证方法。一、随机系数Logit模型1.背景实证产业组织(Empirical Industrial Organization,EIO)是目前产业组织理论的前沿,其中又以Ariel Pakes为带头人,其近期工作论文...

weixin_42298927的博客 2641

Codeforces Round #315 div2 A--Music 水题可结合数学推导

链接:codeforces 569A 这轮比赛打得非常弱。。比如这道题给我很大的困扰。。直到快60miin的时候才静下心好好写了写式子,看了看announcement才反应过来。。这个题可以理解成一个数学题 我想起了阿基里斯追龟悖论 这个悖论大家都明白,实际上揭示了等比级数的存在,我们都知道无穷递缩等比级数为 S=a1/(1-q) 其中 a1 为首项,q0 为公比 那么这个题目,从最开

skyword的专栏 1044

深入解析PVT corner:从wcl到ml的芯片设计关键考量

本文深入解析了芯片设计中的PVT corner概念,重点探讨了从传统WC到先进工艺下WCL、ML等关键工艺角。文章详细阐述了温度反转效应如何使低温WCL成为最严苛的时序场景,并提供了基于先进工艺的实战签核策略与多角多模分析流程,确保芯片在极端工艺、电压、温度下的稳健性。

tree8的博客 526

SARScape实战:集成GACOS数据优化InSAR大气校正全流程

本文详细介绍了如何在SARScape软件中集成GACOS数据,以优化InSAR大气校正的全流程。通过实战步骤,从GACOS数据申请、下载、导入,到在单景干涉图和SBAS-InSAR流程中应用,有效剥离大气相位延迟,显著提升形变监测结果的精度与可靠性,实现从“雾里看花”到“拨云见日”的转变。

weixin_28419039的博客 398

从Keil到VS Code:STM32 AI编程环境搭建实战指南

嵌入式开发环境的选择直接影响编码效率和AI编程工具的落地效果。传统IDE如Keil在代码编辑体验和扩展性上存在局限,而VS Code凭借轻量、插件生态丰富、语言服务协议完善等优势,正成为现代嵌入式开发的主流选择。对于STM32开发者而言,搭建一套基于VS Code的编译、烧录、调试一体化环境,不仅能够提升日常开发流畅度,更是启用AI编程插件的前提。本文将系统梳理VS Code安装配置、STM32扩展工具链组合、CubeMX工程迁移、OpenOCD调试连接等关键环节,并结合实际踩坑经验,帮助开发者快速构建一个

weixin_34090562的博客 455

【SerDes】美信GMSL2-CSI调试心得

美信GMSL2加解串器芯片家族广泛应用于车载和工业视觉系统。文章介绍了MAX96717/MAX96717F加串器和MAX96724/MAX96724R解串器的关键特性,包括支持MIPI CSI-2接口、6Gbps传输速率等功能。提供了基于高通平台的demo系统配置和调试步骤,重点阐述了Link Lock、PCLK检测和Video Lock等关键调试环节,并详细说明了像素模式,隧道模式的工作原理及寄存器配置示例。文中还包含通过I2C读写寄存器的具体操作指令,取流freeze可能原因和解决方法。

qq_38089448的博客 2488

Codeforces Round #315 (Div. 2) A. Music

A. Music time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little Lesha loves listening to music via his smar

习惯与规则决定命运 1431

【硬刚Hive】HIVE基础(20):Hive函数(9) over 窗口函数

欢迎关注博客主页:微信搜:import_bigdata,大数据领域硬核原创作者_王知无(import_bigdata)_优快云博客 欢迎点赞、收藏、留言 ,欢迎留言交流!本文由【王知无】原创,首发于 优快云博客!本文首发优快云论坛,未经过官方和本人允许,严禁转载! 本文是对《【硬刚大数据之学习路线篇】从零到大数据专家的学习指南(全面升级版)》的Hive部分补充。 hive窗口函数语法 在前言中我们已经说了avg()、sum()、max()、min()是分析函数,而over()才是窗..

微信搜:import_bigdata,大数据领域硬核原创作者 888

FM1288回声消除芯片调试方案 - 综述

专栏文章概览

优快云mianfeixiazai001的博客 1714

Codeforces Round #315 (Div. 2) A. Exam

codeforces ACM

上千主上-贝库塔 1066

[Dify] 【实战笔记】优化 Excel 电话簿类知识库检索效果的实战技巧

摘要:文章分析了Dify知识库在处理Excel结构化数据(如电话簿)时出现的检索异常问题,发现主要原因是默认召回多条记录且缺乏精准匹配机制。提出两个核心解决方案:1)优化知识库召回参数,包括调整TopK值、提高关键词权重等;2)设计精准提示词模板,明确约束模型行为范围。通过对比测试验证了优化效果,并给出进阶建议如数据格式转换、输出格式化等。最后针对知识检索类AI应用提供了场景适配建议。

技术小甜甜:传播可落地技术,帮助个人和企业降低解决真实场景问题的成本 364

Codeforces Round #315 (Div. 2) A. Music 解题心得

原题: Description Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his favorite songs in a well-known social network ...

advyne9986的博客 198

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

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

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

Codeforces Round #315 (Div. 2) A. Music

A. Musictime limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard outputLittle Lesha loves listening to music via his smartphone. But the smartphone doesn’t

2=10 408

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

B. Inventory-Codeforces Round #315 (Div. 2)

题意:给一个n, 给n个数 (不合法的数为 该数  不在1到n范围内,或者 有重复出现多次的 你要把这n个数中不合法的都替换成合法的,最后输出一个 1到n的一个合法排列(原来是合法的数,其位置不能改变) 把1-n中未出现的数都记录一下,存到一个数组B index=1 然后把输入的数据for一遍。如果出现vis【a[i]】次数大于1的或为零的(不合法),输出B的元素 index++ 如果

缺氧 558

深度学习工具包 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&#39;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(&#39;DeepLearnToolbox&#39;));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(&#39;state&#39;,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&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,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 = &#39;sigm&#39;;%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, &#39;Too big error&#39;);```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(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;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)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;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, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% 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&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 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, &#39;Too big error&#39;);```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(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % 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, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);%% 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(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Codeforces Round #315 (Div. 2) (ABCD题)

A. Music题意:一首歌长度为S秒,已经下载了T秒,下载速度为每q秒的现实时间能下载下来(q-1)秒 的歌曲。现在开始听歌,如果听到还没下载的地方就从0秒的地方开始replay,求一首歌听完需要从0秒听几次(包括一开始那次)思路:我们可以用路程-时间的思路来考虑这道题。 假设两位选手“播放”与“下载”,“播放”的起点是0m处,“下载”的起点是Tm处,终点在Sm处,“播放”的速度是1m/s,“下

a novice 937

Codeforces Round #315 (Div. 2)569A Music(模拟)

DescriptionLittle Lesha loves listening to music via his smartphone. But the smartphone doesn’t have much memory, so Lesha listens to his favorite songs in a well-known social network InTalk.Unfortunat

wb129945130的博客 476

Codeforces Round #315 (Div. 2) B. Inventory

B. Inventorytime limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard outputCompanies always have a lot of equipment, furniture and other things. All of them

2=10 393

Codeforces Round #315 (Div. 2) B. Inventory

B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Companies always have a lot of equipment, furni

习惯与规则决定命运 1750
上一篇: HDU 3530 Subsequence
下一篇: HDU 5375 Gray code
mitic
博客等级 码龄11年 4粉丝 42原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值