当前位置: 首页 > news >正文

Hello 2024(A~D,F1)

新年坐大牢

A - Wallet Exchange 

        题意:共有俩钱包,每回合从其中一个钱包中拿走一块钱,谁拿走最后一块钱谁赢。

        思路:奇偶讨论即可。

// Problem: A. Wallet Exchange
// Contest: Codeforces - Hello 2024
// URL: https://codeforces.com/contest/1919/problem/0
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define pb push_back
#define x first
#define y second 
#define endl '\n'
const LL maxn = 4e05+7;
const LL N = 5e05+10;
const LL mod = 1e09+7;
const int inf = 0x3f3f3f3f;
const LL llinf = 5e18;
typedef pair<int,int>pl;
priority_queue<LL , vector<LL>, greater<LL> >mi;//小根堆
priority_queue<LL> ma;//大根堆
LL gcd(LL a, LL b){return b > 0 ? gcd(b , a % b) : a;
}LL lcm(LL a , LL b){return a / gcd(a , b) * b;
}
int n , m;
vector<int>a(N , 0);
void init(int n){for(int i = 0 ; i <= n ; i ++){a[i] = 0;}
}
void solve() 
{LL a , b;cin >> a >> b;LL t = a + b;if(t & 1){cout <<"Alice\n";}	else{cout<<"Bob\n";}
}            
int main() 
{ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout.precision(10);int t=1;cin>>t;while(t--){solve();}return 0;
}

B - Plus-Minus Split 

        题意:给定一个"+-"串,其中"+"代表了‘’+1“,"-”代表了“-1”.你需要将整个串分成若干份,每一份的价值为子串所代表的数的绝对值,求整个串的最小价值.

        思路:贪心,其实整个串的价值就是最小价值.

        

// Problem: B. Plus-Minus Split
// Contest: Codeforces - Hello 2024
// URL: https://codeforces.com/contest/1919/problem/B
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define pb push_back
#define x first
#define y second 
#define endl '\n'
const LL maxn = 4e05+7;
const LL N = 5e05+10;
const LL mod = 1e09+7;
const int inf = 0x3f3f3f3f;
const LL llinf = 5e18;
typedef pair<int,int>pl;
priority_queue<LL , vector<LL>, greater<LL> >mi;//小根堆
priority_queue<LL> ma;//大根堆
LL gcd(LL a, LL b){return b > 0 ? gcd(b , a % b) : a;
}LL lcm(LL a , LL b){return a / gcd(a , b) * b;
}
int n , m;
vector<int>a(N , 0);
void init(int n){for(int i = 0 ; i <= n ; i ++){a[i] = 0;}
}
void solve() 
{cin >> n;int ans = 0;string s;cin >> s;for(int i = 0 ; i < n ; i ++){if(s[i] == '+'){ans++;}else{ans--;}}	cout << abs(ans) << endl;
}            
int main() 
{ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout.precision(10);int t=1;cin>>t;while(t--){solve();}return 0;
}

C - Grouping Increases 

        题意:给定一个数组,要求将其分成两部分,要求每部分中元素在原数组中的相对位置不能改变,每一部分的价值为:这一部分中,前一个数小于后一个数的个数.求两部分价值之和的最小值。

        思路:可以想到,由于无法改变相对顺序,我们需要从前往后的插入元素.而每一部分的最后一个元素值应当越大越好。因此我们每次插入元素只需要插入到两个部分中尾数小的那部分即可,然后再算出总共价值就是最小价值.

        

    // Problem: C. Grouping Increases// Contest: Codeforces - Hello 2024// URL: https://codeforces.com/contest/1919/problem/C// Memory Limit: 256 MB// Time Limit: 1000 ms// // Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>using namespace std;#define LL long long#define pb push_back#define x first#define y second #define endl '\n'const LL maxn = 4e05+7;const LL N = 5e05+10;const LL mod = 1e09+7;const int inf = 0x3f3f3f3f;const LL llinf = 5e18;typedef pair<int,int>pl;priority_queue<LL , vector<LL>, greater<LL> >mi;//小根堆priority_queue<LL> ma;//大根堆LL gcd(LL a, LL b){return b > 0 ? gcd(b , a % b) : a;}LL lcm(LL a , LL b){return a / gcd(a , b) * b;}int n , m;vector<int>a(N , 0);void init(int n){for(int i = 0 ; i <= n ; i ++){a[i] = 0;}}void solve() {int rear[2] = {inf , inf};int n;cin >> n;for(int i = 0 ; i < n ; i ++){cin >> a[i];}	int ans = 0;for(int i = 0 ; i < n ; i ++){int cnt = 0;for(int j = 0 ; j < 2 ; j ++){cnt += (rear[j] < a[i]);}if(cnt == 0){if(rear[0] < rear[1]){rear[0] = a[i];}else{rear[1] = a[i];}}else if(cnt == 1){if(rear[0] < a[i]){rear[1] = a[i];}else{rear[0] = a[i];}}else{if(rear[0] < rear[1]){rear[0] = a[i];}else{rear[1] = a[i];}ans++;}}cout << ans << endl;}            int main() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout.precision(10);int t=1;cin>>t;while(t--){solve();}return 0;}

F1 - Wine Factory (Easy Version)

        题意:89dae49892db42f5983ab048729a5083.png

88a8e1ee29d34933b473aba12feafc53.png

思路:由于固定了eq?c_%7Bi%7D%20%3D%201e18,也就是前一个水塔的水必定能全部流入后一个水塔.

74de185b108a4143aeb3c0ffafe384e6.png

        这是一开始的eq?O%28N%5E2%29想法,然后发现整个过程其实是一个区间从前往后合并的过程,因此考虑用线段树去解决区间合并问题。

        接下来考虑如何合并:若前面区间还有剩余的水,那么可以由后面的魔法师去变为葡萄酒,因此我们需要知道的是,区间中还剩多少水和区间中的魔法师还剩多少能量。同时我们还可以统计转换了多少葡萄酒。

        每次只需要单点修改和整个区间查询就行了。

// Problem: F1. Wine Factory (Easy Version)
// Contest: Codeforces - Hello 2024
// URL: https://codeforces.com/contest/1919/problem/F1
// Memory Limit: 512 MB
// Time Limit: 5000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define pb push_back
#define x first
#define y second 
#define endl '\n'
#define int long long
const LL maxn = 4e05+7;
const LL N = 5e05+10;
const LL mod = 1e09+7;
const int inf = 0x3f3f3f3f;
const LL llinf = 5e18;
typedef pair<int,int>pl;
priority_queue<LL , vector<LL>, greater<LL> >mi;//小根堆
priority_queue<LL> ma;//大根堆
LL gcd(LL a, LL b){return b > 0 ? gcd(b , a % b) : a;
}
vector<int>a(N , 0);
vector<int>b(N, 0);
vector<int>c(N, 0);
struct info{LL Res;//剩余多少水LL Res_ma;//魔法师还剩余多少能量LL Value;//价值friend info operator + (info a ,info b){info c;c.Value = a.Value + b.Value;c.Res_ma = b.Res_ma + a.Res_ma;if(a.Res > 0){int d = min(a.Res , b.Res_ma);c.Res_ma -= d;c.Value += d;a.Res -= d;}c.Res = a.Res + b.Res;return c;}
};
struct node{info val;
} seg[N * 4];
struct SegTree{void update(int id){seg[id].val = seg[id * 2].val + seg[id * 2 + 1].val;}void build(int id, int l, int r){if (l == r) {seg[id].val = {max(0 * 1LL ,a[l] - b[l]) , max(0 * 1LL , b[l] - a[l]) , min(a[l] , b[l])};}else{int mid = (l + r) / 2;build(id * 2, l, mid);build(id * 2 + 1, mid + 1, r);update(id);}}void modify(int id, int l, int r, int ql, int qr){if (l == ql && r == qr){seg[id].val = {max(0 * 1LL ,a[l] - b[l]) , max(0 * 1LL , b[l] - a[l]) , min(a[l] , b[l])};return;}if (ql > r || qr < l) // 区间无交集return; // 剪枝int mid = (l + r) / 2;if (qr <= mid) modify(id * 2, l, mid, ql, qr);else if (ql > mid) modify(id * 2 + 1, mid + 1, r, ql, qr);else{modify(id * 2, l, mid, ql, mid);modify(id * 2 + 1, mid + 1, r, mid + 1, qr);}update(id);}info query(int id, int l, int r, int ql, int qr){if (ql == l && qr == r) return seg[id].val;int mid = (l + r) / 2;if (qr <= mid) return query(id * 2, l, mid, ql, qr);else if (ql > mid) return query(id * 2 + 1, mid + 1, r, ql, qr);else{return query(id * 2, l, mid, ql, mid) + query(id * 2 + 1, mid + 1, r, mid + 1, qr);}}
};
LL lcm(LL a , LL b){return a / gcd(a , b) * b;
}
int n , m;
void solve() 
{cin >> n >> m;for(int i = 1 ; i <= n ; i ++){cin >> a[i];}for(int i = 1 ; i <= n ; i ++){cin >> b[i];}for(int i = 1 ; i < n ; i ++){cin >> c[i];}SegTree segTree;segTree.build(1 , 1 , n);for(int i = 0 ; i < m ; i ++){int q , x , y , z;cin >> q >> x >> y >> z;a[q] = x;b[q] = y;segTree.modify(1 , 1 , n , q , q);cout << segTree.query(1 , 1 , n , 1 , n).Value << endl;}
}            
signed main() 
{ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout.precision(10);int t=1;
//	cin>>t;while(t--){solve();}return 0;
}

D - 01 Tree 

        题意:先有一颗未知的完整二叉树,非叶子结点的两条与子节点相连的边权一个为0,另一个为1.如今给出了根据dfs序的叶子结点的权值序列,求能否还原出一颗完整二叉树.定义结点的权值为该节点到根节点的边权之和.

        思路:可以发现:同一个父亲的两个叶子结点的权值只差了1,且两个叶子结点中小的那个就是父节点的权值.也就是说,dfs序中若相邻两个数差了1,那么这两个数就是同一个父亲结点的。由此我们可以将同一个父亲的两个叶子结点中大的删除,小的保留,这样就相当于将两个叶子结点给删除了.最后若只剩下一个点没有被删除,且这个点为0,那么就代表了能够通过删除操作只保留一个顶点,反过来也就是说通过这个序列能够形成一个完整二叉树.

      

// Problem: D. 01 Tree
// Contest: Codeforces - Hello 2024
// URL: https://codeforces.com/contest/1919/problem/D
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define pb push_back
#define x first
#define y second 
#define endl '\n'
const LL maxn = 4e05+7;
const LL N = 5e05+10;
const LL mod = 1e09+7;
const int inf = 0x3f3f3f3f;
const LL llinf = 5e18;
typedef pair<int,int>pl;
priority_queue<LL , vector<LL>, greater<LL> >mi;//小根堆
priority_queue<LL> ma;//大根堆
LL gcd(LL a, LL b){return b > 0 ? gcd(b , a % b) : a;
}LL lcm(LL a , LL b){return a / gcd(a , b) * b;
}
int n , m;
vector<int>a(N , 0);
void init(int n){for(int i = 0 ; i <= n ; i ++){a[i] = 0;}
}
void solve() 
{cin >> n;for(int i = 1; i <= n ; i ++){cin >> a[i];}a[0] = a[n + 1] = -inf;vector<int>nex(n + 5 , 0) , pre(n + 5 , 0);for(int i = 1; i <= n ; i ++){nex[i] = i + 1;pre[i] = i - 1;}auto check = [&](int x){return (a[pre[x]] == a[x] - 1) || (a[nex[x]] == a[x] - 1);};vector<int>in(n + 5 , 0);priority_queue<pair<int,int>>ma;for(int i = 1 ; i <= n ; i ++){if(check(i)){in[i] = 1;ma.push({a[i] , i});}}while(!ma.empty()){auto tmp = ma.top();ma.pop();int pos = tmp.y;nex[pre[pos]] = nex[pos];pre[nex[pos]] = pre[pos];if(!in[nex[pos]] && check(nex[pos])){in[nex[pos]] = 1;ma.push({a[nex[pos]] , nex[pos]});}if(!in[pre[pos]] && check(pre[pos])){in[pre[pos]] = 1;ma.push({a[pre[pos]] , pre[pos]});}}int mi = n , bad = 0;for(int i = 1 ; i <= n ; i ++){bad += (!in[i]);mi = min(mi , a[i]);}if(bad == 1 && mi == 0){cout <<"YES\n";}else{cout <<"NO\n";}
}            
int main() 
{ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout.precision(10);int t=1;cin>>t;while(t--){solve();}return 0;
}

相关文章:

Hello 2024(A~D,F1)

新年坐大牢 A - Wallet Exchange 题意&#xff1a;共有俩钱包&#xff0c;每回合从其中一个钱包中拿走一块钱&#xff0c;谁拿走最后一块钱谁赢。 思路&#xff1a;奇偶讨论即可。 // Problem: A. Wallet Exchange // Contest: Codeforces - Hello 2024 // URL: https://cod…...

Python+Torch+FasterCNN网络目标检测识别

程序示例精选 PythonTorchFasterCNN网络目标检测识别 如需安装运行环境或远程调试&#xff0c;见文章底部个人QQ名片&#xff0c;由专业技术人员远程协助&#xff01; 前言 这篇博客针对《PythonTorchFasterCNN网络目标检测识别》编写代码&#xff0c;代码整洁&#xff0c;规…...

v8 pwn利用合集

文章目录 前置知识JS Object 相关Ignition 相关JIT - turboFan 相关starCTF2019 OOB【越界读写map字段】googleCTF2018 jit【浮点数精度丢失导致越界读写】数字经济线下 Browser【Object::toNumber中callback导致的越界写】前置知识 JS Object 相关 V8 中的对象表示 ==> 基…...

JVM:字节码

JVM&#xff1a;字节码 前言1. JVM概述1.1 JVM vs JDK vs JRE1.1.1 JVM1.1.2 JDK1.1.2.1 常用的JDK8是Oracle JDK 还是 OpenJDK 1.1.3 JRE1.1.4 三者之间的关系与区别 1.2 什么是字节码?采用字节码的好处是什么?1.3 Java 程序从源代码到运行的过程1.4 JVM的生命周期1.5 JVM架…...

常见网络设备及功能详解

网络设备 - 交换机 交换机&#xff1a;距离终端用户最近的设备&#xff0c;用于终端用户接入网络、对数据帧进行交换等。 交换机的功能&#xff1a; 终端设备&#xff08;PC、服务器等&#xff09;的网络接入二层交换&#xff08;Layer 2 Switching&#xff09; 网络设备 - …...

Python教程(20)——python面向对象编程基本概念

面向对象 类和对象初始化方法属性和方法self关键字继承多态 面向对象&#xff08;Object-oriented&#xff09;是一种常用的程序设计思想&#xff0c;它以对象作为程序的基本单元&#xff0c;将数据和操作封装在一起&#xff0c;通过对象之间的交互来实现程序的功能。 在面向对…...

C# Winform教程(一):MD5加密

1、介绍 在C#中&#xff0c;MD5&#xff08;Message Digest Algorithm 5&#xff09;是一种常用的哈希函数&#xff0c;用于将任意长度的数据转换为固定长度的哈希值&#xff08;通常是128位&#xff09;。MD5广泛用于校验数据完整性、密码存储等领域。 2、示例 创建MD5加密…...

Mongodb使用指定索引删除数据

回顾Mongodb删除语法 db.collection.deleteMany(<filter>,{writeConcern: <document>,collation: <document>,hint: <document|string>} ) 删除语法中&#xff0c;除了指定过滤器外&#xff0c;还可以指定写入策略&#xff0c;字符序和使用的索引。 …...

虾皮怎么选品:虾皮(Shopee)跨境电商业务成功的关键步骤

在虾皮&#xff08;Shopee&#xff09;平台上进行跨境电商业务&#xff0c;选品是至关重要的一环。有效的选品策略可以帮助卖家更好地了解市场需求&#xff0c;提高销售业绩和客户满意度。以下是一些成功的选品策略&#xff0c;可以帮助卖家在虾皮平台上取得更好的业务成绩。 先…...

QML —— 使用Qt虚拟键盘示例(附完整源码)

示例效果 使用"虚拟键盘"注意 &#xff08;例子的Qt版本:5.12.4&#xff09; 注意一&#xff1a;      /* 必须在main.cpp开始处加入如下代码&#xff0c;否则无法使用"虚拟键盘" */      qputenv(“QT_IM_MODULE”,QByteArray(“qtvirtualkeybo…...

Nacos 持久化及集群的搭建【微服务】

文章目录 一、统一配置管理二、微服务配置拉取三、配置热更新四、多环境共享配置五、Nacos 集群搭建1. 集群结构2. 初始化数据库3. 搭建集群 六、Nginx 反向代理七、启动项目测试 一、统一配置管理 案例练习的时候我们只有两个微服务&#xff0c;管理起来非常简单&#xff0c;但…...

win10下vscode+cmake编译C代码操作详解

0 工具准备 1.Visual Studio Code 1.85.1 2.cmake 3.24.01 前言 当我们只有一个.c文件时直接使用vscodeCode Runner插件即可完成编译&#xff0c;如果我们的工程很复杂包含多个.c文件时建议使用cmake来生成对应的make&#xff0c;指导编译器完成编译&#xff0c;否则会提示各…...

网络安全红队常用的攻击方法及路径

一、信息收集 收集的内容包括目标系统的组织架构、IT资产、敏感信息泄露、供应商信息等各个方面&#xff0c;通过对收集的信息进行梳理&#xff0c;定位到安全薄弱点&#xff0c;从而实施下一步的攻击行为。 域名收集 1.备案查询 天眼查爱企查官方ICP备案查询 通过以上三个…...

【基于openGauss2.1.0企业版安装X-Tuner参数调优工具】

【基于openGauss2.1.0企业版安装X-Tuner参数调优工具】 一、前提条件二、安装X-Tuner 2.1.0: 一、前提条件 已安装了openGauss2.1.0企业版 二、安装X-Tuner 2.1.0: 以root用户登录到服务器 安装以下依赖&#xff1a; yum -y groupinstall "Development tools" yum…...

SpringBoot+Vue轻松实现考试管理系统

简介 本系统基于 Spring Boot 搭建的方便易用、高颜值的教学管理平台&#xff0c;提供多租户、权限管理、考试、练习、在线学习等功能。主要功能为在线考试、练习、刷题&#xff0c;在线学习。课程内容支持图文、视频&#xff0c;考试类型支持考试、练习、问卷。 源码下载 网…...

详解Keras:keras.preprocessing.image

keras.preprocessing.image Keras 库中的一个模块&#xff0c;用于处理和增强图像数据&#xff0c;它提供了一些实用的函数&#xff0c;如图像的加载、预处理、增强等。 常用函数 1、load_img 用于加载图像文件&#xff0c;并返回一个 NumPy 数组表示该图像 示例 from ker…...

来瞅瞅Java 11都有啥新特性

第1章&#xff1a;引言 大家好&#xff0c;我是小黑&#xff01;今天小黑要和咱们聊聊Java 11&#xff0c;这个在Java发展史上占有一席之地的版本。说起Java&#xff0c;咱们都知道&#xff0c;它是一门历史悠久又持续发展的编程语言。Java不仅因其“一次编写&#xff0c;到处…...

Copilot在IDEA中的应用:提升编码效率的得力助手

Copilot在IDEA中的应用&#xff1a;提升编码效率的得力助手 前言: 欢迎来到本篇博客&#xff0c;今天我们将深入探讨 GitHub Copilot 在 IntelliJ IDEA 中的应用。GitHub Copilot 是一款由 GitHub 与 OpenAI 共同开发的人工智能代码生成工具&#xff0c;它能够根据上下文提示…...

【Python】Excel不同sheet另存为不同CSV

我有一个excel&#xff0c;内有不同sheet&#xff0c;现在批量生成不通csv文件&#xff0c;并以sheet名命名&#xff0c;或根据sheet名调整命名。 # 读取新的Excel文件 df pd.read_excel(rD:\itm\data.xlsx, sheet_nameNone)# 遍历每个sheet&#xff0c;将其另存为不同的CSV文…...

软件测试|深入学习 Docker Logs

简介 Docker 是一种流行的容器化技术&#xff0c;它能够帮助用户将应用程序及其依赖项打包成一个可移植的容器。Docker logs 是 Docker 提供的用于管理容器日志的命令&#xff0c;本文将深入学习 Docker logs 的使用和管理&#xff0c;帮助用户更好地监测和解决容器问题。 Do…...

从WWDC看苹果产品发展的规律

WWDC 是苹果公司一年一度面向全球开发者的盛会&#xff0c;其主题演讲展现了苹果在产品设计、技术路线、用户体验和生态系统构建上的核心理念与演进脉络。我们借助 ChatGPT Deep Research 工具&#xff0c;对过去十年 WWDC 主题演讲内容进行了系统化分析&#xff0c;形成了这份…...

Linux相关概念和易错知识点(42)(TCP的连接管理、可靠性、面临复杂网络的处理)

目录 1.TCP的连接管理机制&#xff08;1&#xff09;三次握手①握手过程②对握手过程的理解 &#xff08;2&#xff09;四次挥手&#xff08;3&#xff09;握手和挥手的触发&#xff08;4&#xff09;状态切换①挥手过程中状态的切换②握手过程中状态的切换 2.TCP的可靠性&…...

服务器硬防的应用场景都有哪些?

服务器硬防是指一种通过硬件设备层面的安全措施来防御服务器系统受到网络攻击的方式&#xff0c;避免服务器受到各种恶意攻击和网络威胁&#xff0c;那么&#xff0c;服务器硬防通常都会应用在哪些场景当中呢&#xff1f; 硬防服务器中一般会配备入侵检测系统和预防系统&#x…...

C# 求圆面积的程序(Program to find area of a circle)

给定半径r&#xff0c;求圆的面积。圆的面积应精确到小数点后5位。 例子&#xff1a; 输入&#xff1a;r 5 输出&#xff1a;78.53982 解释&#xff1a;由于面积 PI * r * r 3.14159265358979323846 * 5 * 5 78.53982&#xff0c;因为我们只保留小数点后 5 位数字。 输…...

短视频矩阵系统文案创作功能开发实践,定制化开发

在短视频行业迅猛发展的当下&#xff0c;企业和个人创作者为了扩大影响力、提升传播效果&#xff0c;纷纷采用短视频矩阵运营策略&#xff0c;同时管理多个平台、多个账号的内容发布。然而&#xff0c;频繁的文案创作需求让运营者疲于应对&#xff0c;如何高效产出高质量文案成…...

算法:模拟

1.替换所有的问号 1576. 替换所有的问号 - 力扣&#xff08;LeetCode&#xff09; ​遍历字符串​&#xff1a;通过外层循环逐一检查每个字符。​遇到 ? 时处理​&#xff1a; 内层循环遍历小写字母&#xff08;a 到 z&#xff09;。对每个字母检查是否满足&#xff1a; ​与…...

基于Java+VUE+MariaDB实现(Web)仿小米商城

仿小米商城 环境安装 nodejs maven JDK11 运行 mvn clean install -DskipTestscd adminmvn spring-boot:runcd ../webmvn spring-boot:runcd ../xiaomi-store-admin-vuenpm installnpm run servecd ../xiaomi-store-vuenpm installnpm run serve 注意&#xff1a;运行前…...

深度学习之模型压缩三驾马车:模型剪枝、模型量化、知识蒸馏

一、引言 在深度学习中&#xff0c;我们训练出的神经网络往往非常庞大&#xff08;比如像 ResNet、YOLOv8、Vision Transformer&#xff09;&#xff0c;虽然精度很高&#xff0c;但“太重”了&#xff0c;运行起来很慢&#xff0c;占用内存大&#xff0c;不适合部署到手机、摄…...

Python 训练营打卡 Day 47

注意力热力图可视化 在day 46代码的基础上&#xff0c;对比不同卷积层热力图可视化的结果 import torch import torch.nn as nn import torch.optim as optim from torchvision import datasets, transforms from torch.utils.data import DataLoader import matplotlib.pypl…...

区块链技术概述

区块链技术是一种去中心化、分布式账本技术&#xff0c;通过密码学、共识机制和智能合约等核心组件&#xff0c;实现数据不可篡改、透明可追溯的系统。 一、核心技术 1. 去中心化 特点&#xff1a;数据存储在网络中的多个节点&#xff08;计算机&#xff09;&#xff0c;而非…...