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 阅读详情

相关推荐

R语言分段回归

1.利用虚拟变量进行线性回归 (MEdata.csv的数据来源:https://github.com/ChenQihome9/优快云-Data-Library/blob/master/MEdata.csv) 问题13:针对TAX~GDP,使用分段回归方法,找到其回归方程。编程,并根据程序结果叙述如下几方面问题:(1)分几段最佳?(不超过5段内)(2)分段位置定在哪儿最佳?(3)写出最佳方...

ChenQihome9的博客 1万+

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

PLUS模型土地利用变化模拟使用简介

因子包括自然因子如社会因子,通过计算整理得到新图层,并以tif文件输出到驱动因子的文件夹里,驱动因子文件夹里存放的是tif文件格式。线性回归使用提供的所有的LULC资源数据,可以选择往后预测的年数,选择好数据之后,可以得出预测的每一年的每一用地类型面积数据。在此过程之后,可以继续使用此CARS输入的数据继续模拟,也可返回二(3)中CARS模块,重新输入不同的年份预测。在此过程之后,可以继续使用此CARS输入的数据继续模拟,也可返回二(3)中CARS模块,重新输入不同的年份预测。

qq_42831270的博客 5806

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

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

qq_62696027的博客 589

QCustomPlot实现毫秒级时间轴数据的动态可视化与实时刷新优化

本文深入探讨了如何利用QCustomPlot库高效实现毫秒级时间轴数据的动态可视化与实时刷新。文章从基础配置讲起,详细介绍了时间轴初始化、数据平滑滚动、增量更新与内存管理等核心优化技巧,并分享了应对高频数据的缓冲策略及OpenGL硬件加速等高级优化手段,旨在解决实时图表卡顿问题,提升流畅度。

weixin_29012677的博客 424

二相混合式步进电机闭环矢量控制simulink仿真(含仿真文件)

在位置跟踪伺服系统中二相混合式步进电机闭环矢量控制simulink仿真

qq_39023633的博客 2万+

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

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

曼彻斯特小球童 2328

逆向实战:从x-mini签名到RPC调用,Frida动态分析小红书加密协议

本文通过实战案例,详细拆解了小红书App的加密协议逆向分析过程。从识别x-mini签名等关键参数入手,结合静态分析与Frida动态Hook技术,追踪到核心的RPC调用入口,并最终封装成可独立调用的RPC函数,为安全研究和协议理解提供了完整的技术路径。

moss5的博客 1028

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

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

夏末秋也凉的博客 191

一张图讲透银行个人外汇业务逻辑和实操

个人外汇业务主要分为结售汇和外币兑换两类,前者满足日常跨境需求,后者因投机属性多数银行已暂停。业务核心是利用汇率波动实现货币兑换,满足支付或投资需求。交易涉及客户分类、主流币种、多种渠道和汇率计算规则,需区分直接/间接标价法判断汇率走势。银行通过"货币兑换"科目核算损益,采用期末折算确认盈亏。监管要求包括5万美元年度额度、合法渠道、真实性原则及大额申报等。随着跨境金融数字化发展,掌握基础逻辑和合规要求是安全参与外汇业务的关键。

银行信息系统应用架构详解 288

使用MATLAB/Simulink对一个简单的智能家居温湿度监测与控制系统进行建模和仿真

目录手把手教你学Simulink——基于Simulink的智能家居温湿度监测与控制仿真建模示例一、背景介绍二、所需工具和环境三、步骤详解步骤1:创建Simulink模型步骤2:构建传感器模块步骤3:添加控制器步骤4:构建执行器模块步骤5:连接各部分步骤6:设置仿真参数步骤7:添加观测器步骤8:运行仿真并分析结果四、总结 智能家居系统中的温湿度监测与控制系统是一个典型的物联网(IoT)应用场景,它通过传感器收集环境数据,并根据预设条件自动调节室内温度和湿度以提高居住舒适度。本指南将介绍如何使用MATLAB/S

xiaoheshang_123的博客 291

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

Flutter框架GetX从入门到精通第二篇:路由管理-告别繁琐的Navigator

Flutter框架GetX从入门到精通第二篇:告别繁琐的Navigator。本系列将带你从零开始,一步步掌握 GetX 框架的核心功能与实战技巧。

鹏多多的博客 170

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

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

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

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

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

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

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

@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、付费专栏及课程。

余额充值