CF #762 Div.3(A ~ E)

【信息科学与工程学】【制造工程】第三十六篇 机械工程与自动化101 本系统通过多模型集成、知识增强、主动学习和持续优化等关键技术,实现了高效、高质量的自动化文本语料标注。系统采用模块化设计,支持灵活扩展,能够处理不同类型的文本数据,适应多样的标注需求。 阅读详情

CF #762 Div.3

A Square String?(翻译)

Description:

​ A string is called square if it is some string written twice in a row.

​ 如果一个字符串是某个连续写了两次的字符串,则称为square

​ 给定字符串 判断字符串是否是square

Method:

​ 一开始没有读懂题目 也没有仔细看样例 所以草率地认为是含有奇数个字符时 NO

​ 其实就是扫一遍判断是否是由两个相同字符串构成

Code:

void solve()
{
    cin >> s;
    int n = s.size();
    bool flag = true;
    if(n & 1)   flag = false;
    else
    {
        for(int i = 0; i < n / 2; i++)
            if(s[i] != s[i + n / 2])    flag = false;
    }
    if(flag)    puts("YES");
    else puts("NO");
}

B Squares and Cubes(翻译 + 枚举)

Description:

​ Polycarp likes squares and cubes of positive integers

​ Polycarp喜欢正整数的平方和立方

​ 输出小于n的不重复的立方数和平方数的个数

Method:

在计算时间复杂度后直接暴力枚举 最坏情况下取20 * 1e9 O(20 * 1e4) 用map来记录是否重复

Code:

void solve()
{
    int n;
    cin >> n;
    map<int, bool> vis;
    int res = 1;
    for(int i = 2; i * i <= n; i++)
        if(vis[i * i] == false) res ++, vis[i * i] = true;
    for(int i = 2; i * i * i <= n; i++)
        if(vis[i * i * i] == false) res ++, vis[i * i * i] = true;
    cout << res << endl;
}

C Wrong Addition(枚举 + 题意)

Description:

​ 给出两个数 a 和 s 题目定义了一种新的加法 设b 使 a + b = s

​ 若b存在 输出b 若b不存在 输出-1

Method:

​ 按题目模拟 我原有的思路是使用字符串 但是其实LL可以使用%提取最后一位 /消去一位更加方便

​ 1 保证每次减法中得到的数必须是<=10的

​ 2 当s已经走完了 但是a还没走完 不符合题意

​ 3 借位时遇到了0 借不到

Code:

void solve()
{
    LL a, s;
    cin >> a >> s;
    vector<int> b;
    while(s)
    {
        int x = a % 10;
        int y = s % 10;
        if(y - x >= 0)  b.push_back(y - x);
        else 
        {
            s /= 10;
            y += 10 * (s % 10);
            if(y >= 10 && y - x <= 10)  b.push_back(y - x);//如果下一位是0 借位失败
            else 
            {
                cout << -1 << endl;
                return ;
            }
        }
        a /= 10;
        s /= 10;
    }

    if(a)   cout << -1 << endl;
    else 
    {
        while(b.back() == 0)    b.pop_back();
        for(int i = (int)b.size() - 1; i >= 0; i --)    cout << b[i];
        cout << endl;
    }
}

D New Year’s Problem(二分 || 贪心)

Description:

​ 给出n行m列的矩阵 要求从每一列中选择一个

​ 最多在m-1行里选 求所有被选择的物品的最小值的最大值

Method:

​ 总结:因为没有读清楚题目 题意提炼得不够精确 然后又因为题目给的m n换位了 想了很久

​ 当我们看到最小值最大的时候 毫无疑问这道题有二分解法

​ 我们可以枚举整个矩阵 每一行中寻找比mid大的 标记为true

​ 每一列选多了没关系 因为后面可以通过二分来将mid扩大

​ 枚举后 若是有一列 没有true 那就意味着没有该列中不存在大于等于mid的数 return false

​ 由抽屉原理可知 因为要在m-1行里选m件物品 必然有一行是选了两件及以上的 若是不满足这个条件 return false

​ 因为当return false的时候 r是没有可能成为答案的 所以 r = mid - 1 相应的mid = l + r + 1 >> 1

Code:

bool check(vector<vector<int> > &mp, int x)
{
    vector<bool> st(m);

    bool pair = false;
    for(int i = 0; i < n; i++)//遍历行
    {
        int c = 0;
        for(int j = 0; j < m; j++)//遍历列
        {
            if(mp[i][j] >= x)     
                st[j] = true, c ++;
        }
        if(c > 1)   pair = true;
    }

    if(!pair)  return false;
    bool ans = true;
    for(auto t : st)   ans = ans && t;
    return ans;
}

void solve()
{
    int maxx = 0;
    cin >> n >> m;
    vector<vector<int> > mp(n, vector<int>(m));
    
	for (int i = 0;  i < n; i ++)
		for (int j = 0; j < m; j ++)
		    cin >> mp[i][j], maxx = max(maxx, mp[i][j]);
	
    int l = 1, r = maxx;
    while(l < r)
    {
        int mid = (l + r + 1) >> 1;
        if(check(mp, mid))  l = mid;
        else r = mid - 1;
    }
    cout << l << endl;
}

E MEX and Increments(模拟 + 思维)

Description:

​ 给定长度为n的序列 我们可以对序列进行op操作 : 任选一个数给他加上一

​ 如果我们通过op能够构造出MEX == k (0 <= k <= n) 输出op的次数

​ 反之输出-1

​ MEX 的意思就是数组中最小的不存在的数

Method:

​ 简化题目 题目的目的是空出第k个数 那就意味着任何0~k-1都要存在于数组中 并使k不存在数组中

​ 使k不存在于数组中非常简单 直接把k+1即可

​ 我们着重来讨论一下前面一种情况

​ 因为我们从0开始询问是否能构造出NEX 所以当MEX == k成立的时候 0~k-1是必然存在的

​ 这时询问下一个k的时候 如果能从0~k - 2中选出一个填到k - 1 那就可以通过了

​ 反之 若不能选出填补k - 1 那后面也不需要在看了 永远都无法补全了

​ 观察一下样例 样例3和4在第一次出现-1之后一直都是-1 结合分析 得到猜想 在一次-1以后都是-1

​ 我们的解题思路是 如何来判断是否能填上那个空

​ 当MEX == k时 我们只需要查看k - 1是否能够存在 因为MEX == k - 1的时候 0~k - 2必然存在了

​ 若是0~k - 2中含有多余的元素补上k-1这个空 那么MEX == k就可以成立

​ op数 = 补到k - 1需要的op + k的个数

​ 注意的是op数是每次MEX中叠加的 为什么呢 因为每次取得MEX的操作是可以继承到下一次的

Code:

const int N = 200010;
int n;
stack<int> st;
int q[N], num[N];
LL f[N];

void init()
{
    for(int i = 0; i <= n; i++)
        num[i] = 0;
    while(st.size())    st.pop();
}

void solve()
{
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> q[i], num[q[i]] ++;//记录个数
    sort(q + 1, q + n + 1);//排序

    for(int i = 0; i <= n; i++) f[i] = -1;//初始化就设为-1 比较方便

    LL sum = 0;
    for(int k = 0; k <= n; k++)
    {
        if(k > 0 && num[k - 1] == 0)//k - 1 >= 0且k - 1为0
        {
            if(st.empty())  break; //找不到多余的来补充
            int t = st.top(); //栈顶一定是离得最近的 最适合取用
            st.pop();
            sum += k - 1 - t;
        }
        f[k] = sum + num[k]; // t -> k - 1 + k -> k + 1
        while(k > 0 && num[k - 1] > 1) //把多余的加入到栈中等待取用
            num[k - 1] --, st.push(k - 1); 
    }

    for(int i = 0; i <= n; i++)
        cout << f[i] << (i == n ? '\n' : ' ');
    init();
}
HID设备开发避坑指南:如何利用Windows内置驱动快速实现USB键盘模拟 本文详细解析了HID设备开发中的免驱方案与USB键盘模拟技术,重点介绍了HID协议的核心优势、开发基础架构及Windows平台的实现方法。通过实战案例和代码示例,帮助开发者快速掌握USB键盘模拟技术,避免常见开发陷阱,提升设备兼容性和性能。 阅读详情

相关推荐

用SOEM库搞定汇川SV660N伺服电机:一个Linux C程序员的EtherCAT实战笔记

本文详细介绍了如何在Linux系统下使用SOEM库驱动汇川SV660N伺服电机,包括环境搭建、EtherCAT从站设备识别、PDO映射配置、状态机切换与运动控制等关键步骤。通过实战代码示例和常见问题排查指南,帮助开发者快速掌握工业自动化中的EtherCAT通信技术,实现对伺服电机的精准控制。

weixin_29185199的博客 424

1619B. Squares and Cubes

题目链接 思路 每一个数是从1≤n≤1091 \leq n \leq 10^91≤n≤109,他开平方后取值ttt为 1≤t<4×1041\leq t < 4\times10^41≤t<4×104,开三次方后取值ttt为1≤t≤1031\leq t \leq10^31≤t≤103。所以对于每一个给出的nnn,我们只需让iii从111∼\sim∼n\sqrt{n}n​遍历一遍,看i2,i3i^2,i^3i2,i3的值有多少在1∼n1\sim n1∼n之间即可 代码 #include<

lrzHHl的博客 516

Excel VBA | 一键批量生成对账单

根据对账单总表一键批量生成N家独立的客户对账单。

Microgoblins的博客 6982

B. Squares and Cubes

time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp likes squares and cubes of positive integers. Here is the beginning of the sequence of numbers he likes:11,44,88,99, .... For...

无知的我 935

BeikeShop跨境电商独立站系统V1.5.0免授权全开源版

BeikeShop 一款开源好用的跨境电商系统,BeikeShop 是基于 Laravel 开发的一款开源商城系统,主要面向外贸/跨境电商行业提供商品管理、订单管理、会员管理、支付、物流、系统管理等功能。BeikeShop商城 Beike多语言商城 多货币商城B2C商城系统 代码100%开源 PHP商城系统 H5/PC商城 跨境电商系统 跨境商城系统 电商商城系统 Laravel 9 框架插件化开发,MVC架构 支持插件市场。Event 机制实现Hook功能,自定义可视化装修。

817

SAP-ABAP:SAP信贷管理核心:CL_UKM_BUPA_FACTORY类完整解析与实践指南

SAP信贷管理核心类CL_UKM_BUPA_FACTORY解析 CL_UKM_BUPA_FACTORY是SAP信贷管理(UKM)模块的核心类,作为业务伙伴信贷数据的中央控制台,它提供: 统一入口:标准化实例化客户/供应商信贷对象 主要功能: 获取单条/批量业务伙伴数据 安全保存数据变更 封装底层数据访问逻辑 典型应用场景: 信贷主数据批量维护 自动化限额调整 订单信贷实时检查 性能优化建议: 使用批量方法替代循环单条处理 合理设置字段选择 实施缓存策略 该类通过简洁API简化复杂信贷操作,是SAP信贷管理开

baidu_35680696的博客 1208

B - Squares and Cubes(补题)

题目如下: Polycarp likes squares and cubes of positive integers. Here is the beginning of the sequence of numbers he likes:1,4,8,9, .... For a given numbernn, count the number of integers from1tonthat Polycarp likes. In other words, find the number ...

m0_63650164的博客 641

2024阅读AOSP源码的正确打开姿势

在Android系统开发中,阅读AOSP(Android Open Source Project)源码是非常重要的环节。然而,如何构建一个优雅的阅读环境却是一个不容忽视的问题。本文将介绍不同工具和方法下阅读AOSP源码的正确姿势,并对比其优缺点。

虎哥LoveDroid 2706

kExercise 5.4 Table of reciprocals, squares, cubes, and fourth powers.

Exercise 5-4. Define a two-dimensional array, data[11][5] , of type double. Initializethe elements in the first column with values from 2.0 to 3.0 inclusive in steps of 0.1.If the first element in a r...

weixin_30851409的博客 182

ZYNQ 使用AXI_BRAM实现PS与PL 数据交互数据交互

有时CPU需要与PL进行小批量的数据交换,可以通过Block RAM实现。通过Zynq 的GP Master 接口读写PL端的 BRAM,实现PS与PL的交互。加入自定义的 FPGA 程序,并利用 AXI4 总线进行配置,通知何时读写 BRAM。CPU通过 AXI BRAM Controller 读取 BRAM 数据,CPU 仅配置自定义的 PL BRAM Controller 的寄存器,不通过它读写数将BRAM与socket进行联合使用,将电脑的数据发到PS端,PS端放在PL端,PL端再发给PS端,P据。

wangjie36的博客 1万+

RK3568 OpenHarmony3.2 NFC 驱动适配(PN7150)II

承接上文《RK3568 OpenHarmony3.2 NFC 驱动适配(PN7150)I》,继续PN7150 NFC模块的整体适配。本文主要介绍包括HDI实现层、框架层以及设备适配层的代码修改思路。具体包括vendor_adaptor、hdi_service等;以及foundation下的frameworks、services等。此外还包括相关三方库libnfc-nci在鸿蒙平台的移植和适配。需要注意的是,当前nfc适配只是基于作者手上的RK3568平台以及相关OpenHarmony3.2的代码。

Martian_Jonas的博客 1357

Squares and Cubes CodeForces - 1619B

题目链接:Squares and Cubes cbrt()函数是cmath标头的库函数,用于查找给定数字的立方根 ,它接受数字并返回立方根 #include<stdio.h> #include<math.h> #include<map> #include<algorithm> using namespace std; map<long long ,int >sum; const int maxn=1e9+5; int main() { in

weixin_52513845的博客 513

【30天从零玩转AI应用开发】第16篇:智能体Agent入门——ReAct框架原理+首个会思考、会动手的AI实战

摘要: 本文介绍了AI智能体(Agent)的核心概念及其与普通大模型(LLM)的区别。通过ReAct(Reason+Act)框架,智能体实现了自主思考、调用工具和分步执行的能力。文章详细讲解了LangChain Agent的四大组件,并推荐新手使用ZERO_SHOT_REACT_DESCRIPTION类型。最后提供了一个完整的智能体实战代码示例,该智能体具备数学计算和天气查询功能,能够自主选择工具完成任务,展示了AI从”被动回答“到”主动行动“的关键进化。

在上海谋生的软件喵记录喵生 626

cf div3 762 题解

1.A.Square String? 题目链接:https://codeforces.com/contest/1619/problem/A 大致题意: 如果一个字符串在一行中被写了两次,那么这个字符串就叫做square, 判断一个字符串是不是square 思路: 很明显,判断前半部分与后半部分是否相同即可 特别的,如果字符串长度为奇数,必然不是 #include <bits/stdc++.h> using namespace std; void solve() { string s;

wuzhen123321的博客 2875

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

2021.12.20cf #762 Div3 (补题)

20211220cf补题(不全待补)

m0_62289613的博客 324

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

[cf] Codeforces Round #762 (Div. 3)

目录前言A.CODEB.CODEC.D.CODE 前言 基础不牢,地动山摇 传送门 : A. 找一个字符串看是否可以对半 CODE void solve() { string s;cin>>s; int len = s.size(); string t1 = "" , t2 =""; for(int i = 0 ;i<len/2;i++) t1+=s[i]; for(int i = len/2;i<len;i++) t2+=s[i]; // cout&lt

qq_34364611的博客 629

深度学习工具包 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 #762 (Div. 3) G. Unusual Minesweeper

#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=2e5+10; int t,n,k,fa[N],val[N]; struct node{int a,b,c,d;}p[N]; map< int, vector<pair<int,int>> > v,v2; void init(){for(int i=1;i<=n;i++) fa[i]=i,val[i

我们仍未知道那天所看见的花的名字。 350

赛后题解:Codeforces Round #852 (Div. 2)1793C Dora and Search

赛后题解:Codeforces Round #852 (Div. 2)1793C Dora and Search

yingjiayu12的博客 711

High-Resolution Image Synthesis with Latent Diffusion Models # 基于潜在扩散模型的高分辨率图像合成

Robin Rombach 1 * Andreas Blattmann1 * Dominik Lorenz 1 Patrick Esser ® Björn Ommer 1 1 Ludwig Maximilian University of Munich & IWR, Heidelberg University, Germany ° Runway ML慕尼黑路德维希-马克西米利安大学 & 德国海德堡大学 IWR ° Runway MLhttps://github.com/CompVis/latent-diff

u013250861的博客 83

High-Resolution Image Synthesis with Latent Diffusion Models 基于潜在扩散模型的高分辨率图像合成

Robin Rombach 1 * Andreas Blattmann1 * Dominik Lorenz 1 Patrick Esser ® Björn Ommer 1 1 Ludwig Maximilian University of Munich & IWR, Heidelberg University, Germany ° Runway ML慕尼黑路德维希-马克西米利安大学 & 德国海德堡大学 IWR ° Runway MLhttps://github.com/CompVis/latent-diff

u013250861的博客 137

Day1.(每日一题)B. Squares and Cubes(C语言版)

#include <stdio.h> int main() { int t; scanf("%d",&t); while(t--) { long long int cnt=1,cnt2=0,i=2,j=2,n,a,b; scanf("%lld",&n); a=i*i; b=i*a; for(i=2;(a<=n)||(b<=n);i++) { a=i*i; b=i*a; if(a<=n) cnt+...

qq_61953860的博客 434

[9] Squares and Cubes

map(codeforces)

syj2347的博客 334

CF1619B Squares and Cubes

题目大意 求 nnn 以内有多少个完全平方数或完全立方数。 1≤n≤1091 \leq n \leq 10^91≤n≤109。 解题思路 考虑容斥。 nnn 以内是完全平方数或完全立方数的数的个数 === nnn 以内是完全平方数的数的个数 +++ nnn 以内是完全立方数的数的个数 −-− nnn 以内是完全平方数且是完全立方数的数的个数。 显然,nnn 以内是完全平方数的数的个数 =n2=\sqrt[2]{n}=2n​,nnn 以内是完全立方数的数的个数 =n3=\sqrt[3]{n}=3n​。 再看

orz 794

CFdiv3之B. Squares and Cubes

这是链接 B. Squares and Cubes Polycarp likes squares and cubes of positive integers. Here is the beginning of the sequence of numbers he likes:11,44,88,99, .... For a given numbernn, count the number of integers from11tonnthat Polycarp likes. In ot...

m0_52075409的博客 535

选型笔记:Type‑C 扩展坞方案评估|DP1.4 转 HDMI2.0 桥接芯片 GSV2201S@ACP

本文记录 GSV2201S 这款 DP1.4a 转 HDMI2.0 桥接芯片评估,梳理视频、HDCP、PD 集成能力,总结 Type‑C 转接 Dongle、扩展坞方案的适配边界,以及差分走线、PD 时序、HDCP 握手等高频调试问题,为 C 口视频转接方案选型提供参考。

ACP广源盛的博客 216

ThunderKittens 深度解析:一个不基于 MLIR 的 C++ 模板 GPU DSL

Triton 是"让更多人能写 GPU kernel",ThunderKittens 是"让会写的人写得更爽"。前者用 MLIR 换易用性,后者用 C++ 模板换可控性。它们不是替代关系,而是覆盖了 GPU 编程光谱的两端。ThunderKittens 的出现,本质上是对"GPU DSL 必须基于 MLIR"这一默认假设的挑战。编译期类型系统本身就可以是一个强大的 DSL 基础设施,不需要中间 IR,不需要黑盒 pass,也能实现 tile 级抽象和零运行时开销。

Maxwell_Newton的博客 330
上一篇: AtCoder ABC 239题解(A ~ E)
下一篇: CF #776 Div.3题解(A ~ E)
a simple_boy
博客等级 码龄5年 1粉丝 50原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值