The 6th Zhejiang Provincial Collegiate Programming Contest

Triton server的部署、构建、backend插件机制代码梳理、模型加载、自定义C++backend流程 Triton inference server的部署、构建、backend机制代码详细梳理、模型加载过程、自定义C++backend流程. 阅读详情

A - Second-price Auction

题意:找到最高出价人,然后找到第二高的价格

代码:

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<string.h>
#include<stdlib.h>
#include<cstdio>
#include<queue>
#define mod 1e9+7
#define ll long long
#define MAXSIZE 100005
#define inf 0x3f3f3f3f
#define eps 1e-7
#define PI acos(-1.0)
using namespace std;
int bid[1005];
int main()
{
    int t,n;
    cin>>t;
    while(t--)
    {
        int maxnum=0,pos;
        cin>>n;
        for(int i=0;i<n;i++){
            cin>>bid[i];
            if(maxnum<bid[i]){
                maxnum=bid[i];
                pos=i+1;
            }
        }
        sort(bid,bid+n);
        cout<<pos<<" "<<bid[n-2]<<endl;
    }
    return 0;
}

B - Light Bulb

题意:给出H,h,D求出最长的L,这题采用的偷巧的方法,看见精度最多只有0.01,因此直接暴力,数学方法也可以写,但是当时没有考虑那么多,看见AC了马上就跳过了

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<string.h>
#include<stdlib.h>
#include<cstdio>
#include<queue>
#define mod 1e9+7
#define ll long long
#define MAXSIZE 100005
#define inf 0x3f3f3f3f
#define eps 1e-7
#define PI acos(-1.0)
#define N 105
using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
       double H,h,D;
       cin>>H>>h>>D;
    double maxL=0;
        for(double x=0;x<=D*h/H;x+=0.01){
            double ans;
            ans=(D*h+D*x-x*x-H*x)/(D-x)+eps;
            if(maxL<ans)
                maxL=ans;
        }
        printf("%.3lf\n",max(maxL,D*h/H));
    }
    return 0;
}

C - Connect them

题意:kruskal算法,但是最后的排序有点烦

代码:

#include<iostream>
#include<algorithm>
using namespace std;
int t,n,cnt;
int parent[105];
struct Edge
{
    int u,v,w;
} edge[5005],ans[5005];
void init()
{
    for(int i=0; i<105; i++)
        parent[i]=i;
}
int findpa(int x){
    return parent[x]==x?x:findpa(parent[x]);
}
bool cmp1(Edge x , Edge y){
    if(x.w!=y.w)
        return x.w<y.w;
    return x.u<y.u;
}
bool cmp2(Edge x , Edge y){
    if(x.u!=y.u)
        return x.u<y.u;
    return x.v<y.v;
}
int kruskal(){
    sort(edge,edge+cnt,cmp1);
    int countedge=0;
    for(int i=0;i<cnt;i++){
        int x=findpa(edge[i].u);
        int y=findpa(edge[i].v);
        if(x!=y){
            parent[y]=x;
            ans[countedge].u=edge[i].u;
            ans[countedge].v=edge[i].v;
            countedge++;
        }
    }
    return countedge;
}

int main()
{
    cin>>t;
    while(t--)
    {
        init();
        cin>>n;
        cnt=0;
        for(int i=0; i<n; i++)
            for(int j=0; j<n; j++)//存边
            {
                int x;
                cin>>x;
                if(i<j&&x>0)
                {
                    edge[cnt].u=i;
                    edge[cnt].v=j;
                    edge[cnt].w=x;
                    cnt++;
                }
            }
        int judge=kruskal();
        if(judge!=n-1)//判边
            cout<<-1<<endl;
        else {
            sort(ans,ans+judge,cmp2);//控制输出
            for(int i=0;i<judge;i++){
                if(i!=0)cout<<" ";
                cout<<ans[i].u+1<<" "<<ans[i].v+1;
            }
            cout<<endl;
        }

    }
    return 0;
}

D – Derivative

挖坑待填

E - Disaster Area Reconstruction

挖坑待填

F - 80ers' Memory

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<string.h>
#include<stdlib.h>
#include<cstdio>
#include<queue>
#define mod 1e9+7
#define ll long long
#define MAXSIZE 100005
#define inf 0x3f3f3f3f
#define eps 1e-7
#define PI acos(-1.0)
using namespace std;
string s[105];
int main()
{
    int t,n;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>s[i];
    cin>>t;
    for(int i=0;i<t;i++){
        int ans=0;
        int m;
        string ss;
        cin>>m;
        for(int j=0;j<m;j++){
            cin>>ss;
            for(int k=0;k<n;k++){
                if(ss==s[k]){
                    ans++;
                    break;
                }
            }
        }
        cout<<ans<<endl;
    }

    return 0;
}

G – Reforestation

挖坑待填

H - Treasure Map

挖坑待填

I - A Stack or A Queue?

题意:给出起始状态和最终状态,判断这是栈还是队列

代码:

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<string.h>
#include<stdlib.h>
#include<cstdio>
#include<queue>
#define mod 1e9+7
#define ll long long
#define MAXSIZE 100005
#define inf 0x3f3f3f3f
#define eps 1e-7
#define PI acos(-1.0)
using namespace std;
int a[105],b[105];
int flag1,flag2,n;
void judge1(){
    for(int i=0;i<n;i++){
        if(a[i]!=b[i]){
            return ;
        }
    }
    flag1=1;
    return ;
}
void judge2(){
    for(int i=0;i<n;i++){
        if(a[i]!=b[n-i-1]){
            return ;
        }
    }
    flag2=1;
    return ;
}
int main()
{
    int t;
    cin>>t;
    while(t--){
        flag1=flag2=0;
        cin>>n;
        for(int i=0;i<n;i++)
            cin>>a[i];
        for(int j=0;j<n;j++)
            cin>>b[j];
        judge1();
        judge2();
        if(flag1&&!flag2)
            cout<<"queue"<<endl;
        else if(flag2&&!flag1)
            cout<<"stack"<<endl;
        else if(flag1&&flag2)
            cout<<"both"<<endl;
        else if(!flag1&&!flag2)
            cout<<"neither"<<endl;
    }
    return 0;
}


J - Dream City

题意:每个树有一定的金币,然后每天都会长出一定的金币,每天都要砍树,求在规定天数内,最多可以砍多少的钱

代码:

#include <iostream>
#include <cstring>
#include <cstdio>
#include <string>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
using namespace std;
#define maxn 255
int T, N, M;
int dp[maxn][maxn];
struct Node{
    int a, b;
}node[maxn];
int Max(int a, int b){
    return a>b?a:b;
}
bool cmp(Node x, Node y){
    return x.b < y.b;
}
int main(){
    scanf("%d", &T);
    while(T--){
        scanf("%d%d", &N, &M);
        for(int i = 1; i <= N; i++) scanf("%d", &node[i].a);
        for(int i = 1; i <= N; i++) scanf("%d", &node[i].b);
        memset(dp, 0, sizeof(dp));
        sort(node+1, node+1+N, cmp);
        for(int i = 1; i <= N; i++){
            for(int j = 1; j <= M; j++){
                dp[i][j] = Max(dp[i-1][j], dp[i-1][j-1] + node[i].a + node[i].b*(j-1));
            }
        }
        printf("%d\n", dp[N][M]);
        
    }
    
    return 0;
}

K - K-Nice

题意:简单题,别想太复杂,一点点填

代码:

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<string.h>
#include<stdlib.h>
#include<cstdio>
#include<queue>
#define mod 1e9+7
#define ll long long
#define MAXSIZE 100005
#define inf 0x3f3f3f3f
#define eps 1e-7
#define PI acos(-1.0)
using namespace std;
int G[20][20];
int main()
{
    int t,n,m,k,z;
    cin>>t;
    while(t--)
    {
        cin>>n>>m>>k;
        memset(G,0,sizeof(G));
        int cnt=(n-2)*(m-2)-k;
        if(cnt!=0)
        {
            for(int i=0; i<n; i++)
            {
                for(int j=1; j<m-1; j++)
                {
                    G[i][j]=(cnt--);
                    if(cnt==0)
                        break;
                }
                if(cnt==0)
                    break;
            }
        }

        for(int i=0; i<n; i++)
        {
            for(int j=0; j<m; j++)
            {
                if(j!=0)
                    cout<<" ";
                cout<<G[i][j];
            }
            cout<<endl;
        }
    }

    return 0;
}





YOLO蒸馏原理篇之---MGD、CWD蒸馏 本文详细介绍了特征蒸馏中的两种经典有效方法,MGD和CWD蒸馏 阅读详情

相关推荐

手把手教你用手机号注册的Apple ID成功登录Developer账户(避坑指南)

本文详细解析了使用手机号注册的Apple ID登录开发者账户时常见的'不符合使用条件'报错问题,并提供了从添加可验证邮箱到设置主账号的四步解决方案。特别针对Apple Developer账户的验证机制,帮助开发者避免因邮箱缺失导致的登录失败,提升账户激活成功率。

z5a6b的博客 1217

The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemB:Light Bulb

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3203 题意:求影子的最长长度L; 当灯,人头和墙角成一条直线时(假设此时人站在A点),此时的长度是影子全在地上的最长长度。当人再向右走时,影子开始投影到墙上,当人贴着墙,影子长度即为人的高度。所以当人从A点走到墙,函数是先递增再递减,为凸性函数,所以我们可以用...

weixin_30548917的博客 111

Linux内存优化:KSM技术原理与实践指南

内存共享是提升虚拟化环境资源利用率的关键技术,其核心原理是通过识别相同内容的内存页进行合并。Linux内核的KSM(Kernel Samepage Merging)机制采用红黑树数据结构管理内存页,通过多级哈希比较算法实现高效合并。该技术能显著降低物理内存消耗,提升CPU缓存命中率,特别适用于运行大量相似虚拟机实例的场景。在容器化和云计算环境中,KSM与NUMA优化、内存气球等技术协同,可实现40%-60%的内存节省。典型应用包括金融云平台的高密度虚拟机部署,以及Kubernetes集群的基础镜像优化。

weixin_28730353的博客 369

C - Connect them (The 6th Zhejiang Provincial Collegiate Programming Contest )

题目链接:Click 题意:有n台电脑,现在给你每两台电脑之间连接所需要的权值,如果权值为0,代表不能连接,问如果把所有电脑全部连接起来的最小花费的连接方式。 思路:这道题目看上去就是一道最小生成树的题,然后我就找出kruskal的模板敲上去,结果超时了。。一般这种时候我就会先放下,和队友看其他题目,最后一个小时的时候,我回来看这道题,发现以前貌似见到过这道题,好像用到了并查集。然后就开始重新搞

工厂搬砖的代码小白 512

Halcon Socket TCP通讯:从算子调用到工业视觉系统集成

本文详细介绍了Halcon Socket TCP通讯在工业视觉系统中的应用与优化技巧。从基础算子调用到高并发处理,再到与PLC、机器人及MES系统的集成实战,提供了全面的解决方案和性能优化建议,帮助开发者高效实现工业视觉系统的通讯需求。

weixin_33502772的博客 248

从零开始:手把手教你检查并更新英伟达GPU驱动和CUDA版本(Windows/Linux双平台)

本文详细指导如何在Windows和Linux系统上检查并更新英伟达GPU驱动和CUDA版本,解决版本不匹配导致的常见问题。涵盖驱动更新、CUDA Toolkit安装、版本冲突排解及性能优化技巧,帮助开发者高效管理GPU计算环境。

weixin_29237635的博客 701

【ZJCPC2018 第15届 浙江省赛】The 15th Zhejiang Provincial Collegiate Programming Contest(MABLJK 6题)

补题地址:https://zoj.pintia.cn/home/news 搜索15th 本文按照通过率补的题 M. Lucky 7 题意:如果存在从给出的长为n的序列中选择一个数+b 可以被7整除,就YES,不然就NO。 思路:扫一遍即可。 #include<bits/stdc++.h> using namespace std; int main(){ int T; cin>>T; while(T--){ int n, b; cin&g..

小哈里的博客 952

YOLO11实战优化:暗光环境检测 | 引入Retinex增强模块与YOLO11联合训练,解决夜间/低照度场景抓拍痛点

本文探讨了暗光环境下目标检测的技术挑战与解决方案。研究发现,传统CNN模型在低照度条件下性能显著下降,主要由于光子数减少导致信噪比降低、目标特征被噪声淹没。针对这一问题,文章提出将可微分光照增强模块嵌入YOLO检测器的技术路线,重点分析了Retinexformer+YOLO11联合方案的优势。 文章对比了YOLO系列模型在暗光场景的表现,指出YOLO11凭借其C3k2模块、无锚检测头和多任务统一骨干网络,在低对比度图像特征提取方面优于前代产品。同时详细介绍了Retinexformer的理论基础和技术创新,包

2601_95807009的博客 206

The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemF:80ers' Memory

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3207 题意:给出N个关键字符串,然后给出k行,每行Ni个字符串,找出每行有多少个关键字符串。 用strcmp函数比较一下就行了。 #include<bits/stdc++.h> using namespace std; int main() { ...

weixin_30437337的博客 90

企业 IoT 产品安全渗透测试与欧盟 CRA 合规落地实战指南

欧盟 CRA(网络弹性法案)2026-09-11 漏洞报告义务生效,2027-12-11 全面强制产品安全不再是"加分项",而是市场准入的法律门槛本文面向 IoT 企业安全工程师/运维工程师,讲清楚如何从零建立渗透测试能力,并与 CRA 合规要求对齐落地。不讲空话,全是可执行的步骤。IoT 企业安全工程师、运维工程师负责产品合规的技术人员想从"被动响应"转向"主动安全"的团队[ ] 能独立完成 Web 应用渗透测试并输出报告[ ] 能对 REST/GraphQL API 进行安全评估。

探索云原生与智能化驱动下的安全运维新范式。关注DevSecOps、可观测性、AIOps等前沿领域,与您共赴技术前沿。 266

数据结构之博弈树搜索(深度优先搜索)

数据结构之博弈树搜索(深度优先搜索)

LucianaiB的博客 1523

The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemK:K-Nice

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3212 题意:构造出一个n*m的有k个上下左右的和等于中间数的小矩阵的任意矩阵。 就是输出k个全是0的矩阵(符合条件),然后其他的矩阵用数字填掉 1 #include<bits/stdc++.h> 2 using namespace std; ...

weixin_30340745的博客 64

PDAF相位对焦原理

pdaf光路图

camerall 1万+

The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemA:Second-price Auction

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3202 题意:拍卖东西,以第二高价的价格卖给出第一高价的人。输出最后获得东西的人的序号和要出的价钱。 思路:(最笨的方法)用结构体来排序。 1 #include<bits/stdc++.h> 2 using namespace std; 3 s...

weixin_30387423的博客 85

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

The 6th Zhejiang Provincial Collegiate Programming Contest->Problem I:A Stack or A Queue?

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3210 题意:给出stack和queue的定义,一个是先进后出(FILO),一个是先进先出(FIFO),每个样例都有两行,每行n个,判断它们的属性。(我每次都是用最笨的方法。。) 1 #include<bits/stdc++.h> 2 using n...

weixin_30299539的博客 72

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

The 18th Zhejiang Provincial Collegiate Programming Contest

中,由图可知,每个蜂巢相邻着六个蜂巢,所以每次加入蜂巢后,我们可以遍历它周围的六个蜂巢,如果之前的蜂巢出现过,则通过并查集的方式把出现过的蜂巢块加到当前蜂巢下,同时记录当前蜂巢块内有多少个蜂巢和重复的蜂巢个数。联系在一起呢,如果两个圆之间没有冲突,那我们可以剪掉另外一个圆使得剩下这两个没有冲突的圆可以被直接拿走,所以最后。,不会出现圆与圆之间相互嵌套的情况,即至少剪掉一个圆后所有的圆都能拿走。时,先来看至少剪掉两个圆的情况,这种情况下最多只会剩下一个圆,所以无论如何也能成功拿走所有的圆,

zjdysq的博客 1613

老版QQ原生表情gif动态

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

The 17th Zhejiang Provincial Collegiate Programming Contest

The 17th Zhejiang Provincial Collegiate Programming Contest 题目 A B C D E F G H I J K L solved ✔ ???? - - ???? - - - ✔ - ✔ - ✔:比赛时通过;????:赛后通过;⚪:比赛时尝试了未通过;-:比赛时未尝试

lllllan 1657

The 19th Zhejiang Provincial Collegiate Programming Contest VP记录+补题

The 19th Zhejiang Provincial Collegiate Programming Contest VP记录+补题 第19届浙江省赛 19th浙江省赛 题解/补题

HeartFireY的博客 7263

The 7th Zhejiang Provincial Collegiate Programming Contest

The 7th Zhejiang Provincial Collegiate Programming Contest     由于某种原因,今年没有参加ACM,4月17号,比赛,比往年提早了一个月,不过赛后我还是自己默默做了一下题。。及时没有盛大的颁奖典礼。。。。今天先发几道简单的。所有的题目都在这个网址:http://acm.zju.edu.cn/onlinejudg

WonderCoder的专栏 1748

The 16th Zhejiang Provincial Collegiate Programming Contest

传送门: Problem A Problem B Problem C Problem D Problem E 题意: 给你一个长度为长度为nnn的序列,每次你可以选取其中的某一个数aia_iai​,你可以把aia_iai​放到序列的首位。问最少进行多少次操作可以使得序列单调递增。 分析: 先记录原序列中每个数的位置id1id_1id1​,再记录升序排序之后的位置id2id_2id2​,最后...

Chen.Jr的博客 752

The 17th Zhejiang Provincial Collegiate Programming Contest 补题

题目链接 http://codeforces.com/gym/102770 参考题解 A - AD 2020 简要题意: 多组数据,每次给定起始和结束日期 yyyymmdd,询问有多少天的日期表示中含有 202 子串。 解题思路: 日期总数为几百万,不大,可以直接预处理出来,含有 202 子串的日期权值为 1,否则为 0,每次询问就是区间和。更进一步,直接存权值为 1 的日期,询问时二分确定区间长度。 参考代码: #include<bits/stdc++.h> using namespace s

weixin_44059127的博客 1476

The 19th Zhejiang Provincial Collegiate Programming Contest

思路:找到所有的贴纸的中间的空白位置(这样形状的空白位置只有可能是贴纸的中间,不可能是其他边缘造成的),然后暴力枚举,当发现有两个空距离是C type的距离,就把这两个孔判断为C type的(两个贴纸相邻等其他情况中,两个孔的距离一定比C type中的两个孔的距离近)。由贪心策略,从起点到加速点,从一个加速点到达另一个加速点,从加速点再到终点,肯定走的是直线距离(这样的话,在局部使用了贪心,从而使得求解问题成为了一种可能)选取尽可能多的比K大一点点的,使得整体的平均值小于K的数字。

xjsc01的博客 980

The 12th Zhejiang Provincial Collegiate Programming Contest(部分)

A     Ace of Aces Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a mysterious organization called Time-Space Administrative Bureau (TSAB) in the deep universe that we humans have not

叶孤心的专栏 1730

The 5th Zhejiang Provincial Collegiate Programming Contest 部分题解

A Accurately Say "CocaCola"!  暴力 求出 符合条件的情况好了, 反正一定是止于700的 #include #include bool check(int x) { do if(x % 10 ==7) return 1; while(x /= 10); return 0; } int main(void) { int T, n, ans = -1, tem

uiiの技术随笔 1346
上一篇: The 5th Zhejiang Provincial Collegiate Programming Contest
下一篇: 关于动态规划的一个精彩的入门文章(背包)
Linnnnnger
博客等级 码龄11年 71粉丝 79原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值