CCF 2020期末预测之安全指数

202012ccf csp认证前两题:期末预测之安全指数、期末预测之最佳阈值python 100分题解 202012ccf csp认证前两题:期末预测之安全指数、期末预测之最佳阈值python 100分题解一、期末预测之安全指数问题描述解题思路代码二、期末预测之最佳阈值问题描述解题思路代码 一、期末预测之安全指数 问题描述 解题思路 用一个for循环求相乘的结果和,输出0与结果的最大值。 代码 n = int(input()) sum = 0 for i in range(n): w,score = map(int,input().split()) sum += w*score pri 阅读详情

在这里插入图片描述
在这里插入图片描述

#include <iostream>
using namespace std;
int main()
{
   int n,w,s,r;
   cin >> n;
   r=0;
   while(n--)
   {      
      cin >> w >> s;
      r += w*s;      
   }
   if(r<=0)
      r=0;
   cout << r << endl;
   return 0;
}

二刷满分代码:

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int n,w,score,sum=0;
	cin >> n;
	for(int i=0;i<n;i++)
	{
		cin >> w >> score;
		sum+=w*score;
	}
	sum=max(0,sum);
	cout << sum << endl;
	return 0;
}
 
CCF计算机软件能力认证试题练习:202012-1 期末预测之安全指数 期末预测之安全指数 来源:CCF 标签: 参考资料: 相似题目: 题目 期末要到了,小菜同学找到了自己的好朋友顿顿,希望可以预测一下自己这学期是否会挂科。 输入 输出 输入样例1 6 2 60 10 100 0 70 0 0 -10 50 10 60 输出样例1 1220 样例解释1 y=ReLU(1220)=1220{y = \mathrm{ReLU} \left( 1220 \right) = 1220}y=ReLU(1220)=1220 输入样例2 2 -10 100 -1 1 阅读详情

相关推荐

告别枯燥的Unity编辑器脚本:Odin插件如何让游戏数据配置变得像搭积木一样简单?

本文详细介绍了Odin插件如何简化Unity编辑器脚本开发,使游戏数据配置变得直观高效。通过声明式特性和丰富的可视化工具,Odin让开发者告别繁琐的OnGUI代码,实现所见即所得的开发体验。文章重点展示了Odin的核心优势、魔法特性及实战案例,帮助Unity开发者提升工作效率。

weixin_28717411的博客 345

ccf期末预测之安全指数

然后,顿顿根据自己平日里对小菜的暗中观察,以百分制给每一项指标打分,即小菜同学第i ( 1 ≤ i ≤ n ) i(1 \leq i \leq n)i(1≤i≤n)项指标的得分s o c r e i socre_isocre。来表示第i ( 1 ≤ i ≤ n ) i(1 \leq i \leq n)i(1≤i≤n)项指标的重要程度。接下来输入n nn行,其中第i ( 1 ≤ i ≤ n ) i(1 \leq i \leq n)i(1≤i≤n)行包含用空格分隔的两个整数w i w_iw。

weixin_52139745的博客 273

MATLAB/Simulink BLDC电机控制模型搭建:六步换相与速度环实战

无刷直流电机(BLDC)控制是电机驱动领域的核心技术,其六步换相原理通过霍尔信号控制逆变器开关,使定子磁场与转子磁场保持垂直以产生最大转矩。在MATLAB/Simulink中搭建BLDC控制系统,需从电机本体建模入手,结合PWM占空比调节和速度环PI控制器,实现速度闭环与波形观测。该技术广泛应用于电动工具、无人机电调和伺服驱动器等场景。本文详细解析BLDC六步换相逻辑、反电动势建模及Simulink分层设计方法,帮助读者掌握从零搭建完整控制模型的工程实践。

weixin_28273593的博客 207

CCF-CSP 202012-1 期末预测之安全指数 C语言 (满分通过代码+题解)

CCF-CSP 202012-1 期末预测之安全指数 C语言 (满分通过代码+题解)

qq_62696027的博客 589

[MTK][Android P]如何去掉差分包中的preloader分区

最近碰到一个问题,在进行差分升级的时候,会因为某些原因导致preloader hash值不匹配,升级失败,所以需要在差分升级的时候不升级preloader。 解决的方法,就是在制作AB分区的差分升级包的时候,把目标zip解压出来,把ab_partitions.txt中的分区名去掉,同时把preloader.img去掉 修改如下: Project/build/tools/releasetool...

thonmin的专栏 1434

【科研建模】Pycaret自动机器学习框架使用流程及多分类项目实战案例详解

对pycaret的使用流程进行梳理,并详细介绍了基于多分类预测的案例

lys_828的博客 780

CCF 2020-12-1 期末预测之安全指数 100分

试题编号: 202012-1 试题名称: 期末预测之安全指数 时间限制: 1.0s 内存限制: 512.0MB 问题描述: 题目背景 期末要到了,小菜同学找到了自己的好朋友顿顿,希望可以预测一下自己这学期是否会挂科。 题目描述 首先,顿顿选取了如“课堂表现”、“自习时长”、“作业得分”、“社团活动参与度”等n项指标作为预测的依据。 然后,顿顿根据自己平日里对小菜的暗中观察,以百分制给每一项指标打分,即小菜同学第i(1≤...

曼彻斯特小球童 2328

深度解析:LPDDR5 Receiver 的挑战与应对

LPDDR5 的数据速率已经来到Tbit​DataRate1​≈156ps在6400Mbps时也就是说,。👉 这就是为什么成为 LPDDR5 的“标配”。

weixin_43199439的博客 211

CCF 2020-12-1 期末预测之安全指数

题目背景 期末要到了,小菜同学找到了自己的好朋友顿顿,希望可以预测一下自己这学期是否会挂科。 题目描述 首先,顿顿选取了如“课堂表现”、“自习时长”、“作业得分”、“社团活动参与度”等n项指标作为预测的依据。 然后,顿顿根据自己平日里对小菜的暗中观察,以百分制给每一项指标打分,即小菜同学第i(1≤i≤n)项指标的得分scorei是一个[0,100]范围内的整数。 鉴于每一项指标的重要性不尽相同,顿顿用一个[−10,10]范围内的整数wi来表示第i(1≤i≤n)项指标的重要程度。...

夏末秋也凉的博客 191

ChatGPT搭配Claude 4写文献综述效果出奇的好!四步法直接写出逻辑清晰、层次分明的文献综述(附复制即用专业提示词)

请梳理【研究领域】中核心理论的发展演进过程,包括每一阶段理论的核心观点、提出背景与推动力,并指出理论演化中的关键节点或范式转变。请根据以下文献摘要内容,帮助我梳理该主题的研究趋势,包括:常见研究视角、研究方法的演变、研究对象的变化方向等。请根据以下研究空白与我已有的研究基础,帮我生成一个清晰的研究定位,包括:研究主题、研究对象、方法路径和理论框架。先要明确这个研究领域中一个主导或热门的理论,比如社会支持理论、认知负荷理论等,强调这个理论内部的不一致性、适用性争议,通过交代这⼀争议的背景,引发读者兴趣。

智能AI让学术科研更容易 568

Linux 下 OpenClaw 安装全记录:从零到一的保姆级图文教程

本文主要介绍了Linux 下 OpenClaw 安装全记录:从零到一的保姆级图文教程,希望能对学习使用OpenClaw 的同学们有所帮助。 文章目录 1. 背景 2. 实战教程 2.1 步骤一 安装Node.js 2.2 步骤二:安装git 2.3 步骤三:安装并配置OpenClaw 2.4 步骤四:配置OpenClaw 2.5 步骤五:配置模型 2.6 步骤六:对话 3. 后续使用步骤 4. 报错解决方案 5. OpenClaw的卸载

weixin_43178406的博客 10万+

CCF CSP 2020-12-1 期末预测之安全指数 C语言100分

CCF CSP 2020-12-1 期末预测之安全指数 C语言100分 期末预测之安全指数 完成时间11-07 11:02 254B C 正确 100分 耗时15ms 空间使用3.164MB 这题简单,仅附上代码 #include<stdio.h> int main() { int n,sum=0,i,y; scanf("%d",&n); int w[n],score[n][1]; for(i=0;i<n;i++) { scanf("%d %d",&w[i],

JY_0329的博客 3667

基于STM32L4XX、HAL库的MP2672GD-0000-Z充电芯片驱动程序设计

CHG_STAT_GPIO_Port, CHG_STAT_Pin, // 这些宏应由 CubeMX 生成在 main.h。

zhusl6688的博客 494

CCF 2020-12-1-期末预测之安全指数

/*n项指标, 得分score[i], 重要程度w[i] 安全指数:y=relu(x) 输入:n w[i] score[i] n行 输出:y (一定非负) */ #include<stdio.h> int main() { int n,i,cj=0,y; scanf("%d",&n); int w[n],score[n]; for(i=0;i<n;i++) { scanf("%d%d",&w[i],&score[i.

qq_54521127的博客 244

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

CCF2020-12 期末预测之安全指数(python)

n = eval(input(" ")) A = list() for i in range(0, n): score, w = map(int,input().split()) A.append(score * w) if sum(A) >= 0: print(sum(A)) else: print(0) 不知道那里有问题,提交一直不通过!

weixin_45868097的博客 319

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

CCF认证 2020-12 期末预测之安全指数

水题 #include <iostream> using namespace std; int n; int w, score; int sum = 0; int main() { scanf("%d",&n); for(int i = 0; i < n; ++i) { scanf("%d%d",&w,&score); sum += w * score; } if(sum < 0) sum = 0; printf

shadiao_boy的博客 183

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

@2-1 CCF 2020-12-01 期末预测之安全指数

期末预测之安全指数题目描述样例源代码关于这题 题目描述 样例 源代码 #include<iostream> using namespace std; int main() { int n, h, k; int sum = 0; int y; cin >> n; while (n--) { cin >> h >> k; sum += h * k; } y = max(0, sum); cout << y <<

yexiaobai__的博客 155

2020-12 CCF 期末预测之安全指数(100分)

代码: #include<iostream> using namespace std; int main() { int n; cin>>n; int a,b; int sum=0; for(int i=0;i<n;i++) { cin>>a>>b; sum+=a*b; } if(sum>0) cout<<sum<<endl; else cout<<"0"<<en..

m0_49365876的博客 2699

CCF202012-1

CCF 202012-1 期末预测之安全指数 问题描述 试题编号: 202012-1 试题名称: 期末预测之安全指数 时间限制: 1.0s 内存限制: 512.0MB 问题描述: 样例1输入 6 2 60 10 100 0 70 0 0 -10 50 10 60 Data 样例1输出 1220 样例2输入 2 -10 100 -1 15 Data 样例2输出 0 下面是通常解法: #include<bits/stdc++.h> using namespace std; int main()

亮亮的博客 247

CCF-CSP 2020 12 1-期末预测之安全指数

还是简单子的 感动 #include<iostream> using namespace std; int main(){ int n,score,w; cin>>n; int y=0; while(n--){ cin>>w>>score; y+=w*score; } if(y>0){ cout<<y<<endl;} else{ cout<<0<<endl; } } .

weixin_45873505的博客 292

ccf-csp期末预测之安全指数(2020年12月13日)

第一题 送分题,理解题目后,乘积之和就好了 #include<stdio.h> #include<algorithm> #include<queue> #include<stack> using namespace std; const int maxn=1e5+5; typedef long long LL; int s1[maxn]; int n; int main() { scanf("%d",&n); int a,b;

SUN__CGJ的博客 783

CCF-2020-12-1期末预测安全指数

#include<iostream> #include<algorithm> using namespace std; int main(void) { int n,sum=0,x=0; cin>>n; for(int i=0;i<n;i++){ int w,v; cin>>w>>v; x+=w*v; } sum=max(sum,x); printf("%d",sum); return 0; }

weixin_44349851的博客 99

【CSP】202012-1 期末预测之安全指数

2020年 第21次CCF计算机软件能力认证 202012-1 期末预测之安全指数1.0 秒512 MiB。

zhousanguhe的博客 433

【CCF-CSP 2020-12-1 期末预测之安全指数 满分题解-C++】

【CCF-CSP 2020-12-1 期末预测之安全指数 满分题解-C++】

muzillll的博客 99

ccf-2020-12 真题 + 题解 + 解析总结

ccf-2021-04 真题 + 题解 + 解析总结 1. 期末预测之安全指数 题目: 解题思路 + 总结: 代码: #include <iostream> using namespace std; int main() { int n = 0, w = 0, score = 0, sum = 0; //sum一定要记得初始化啊 scanf("%d", &n); while(n --) { scanf("%d%d", &

一只可爱的小猴子的博客 1841

CCF-202012-1---期末预测之安全指数

CCF-202012-1—期末预测之安全指数 题目: 代码: #include <iostream> using namespace std; int main(){ int n,w,score; int sum=0; cin>>n; while(n--){ cin>>w>>score; sum+=w*score; } if(0<sum){ cout<<sum; }else{ cout<<0;

qq_42250642的博客 136
上一篇: 杭电oj 2039 C++ 三角形
下一篇: CCF 202009-2 风险人群筛查 C++
cloudless_sky
博客等级 码龄8年 106粉丝 128原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值