07 2023 档案

摘要:# 线性回归 # 创建数据集 from mxnet import ndarray as nd from mxnet import autograd as ad num_input = 2 num_examples = 1000 true_w = [2, -3.4] true_b = 4.2 x = 阅读全文 »
posted @ 2023-07-31 16:02 o-Sakurajimamai-o 阅读(40) 评论(0) 推荐(0) 编辑
摘要:# [蓝桥杯 2022 省 B] 砍竹子 ## 题目描述 这天,小明在砍竹子,他面前有 n 棵竹子排成一排,一开始第 i 棵竹子的高度为 hi. 他觉得一棵一棵砍太慢了,决定使用魔法来砍竹子。魔法可以对连续的一段相同高度的竹子使用,假设这一段竹子的高度为 H,那么使用一次魔法可 阅读全文 »
posted @ 2023-07-30 23:27 o-Sakurajimamai-o 阅读(36) 评论(0) 推荐(0) 编辑
摘要:# [蓝桥杯 2022 省 B] 李白打酒加强版 ## 题目描述 话说大诗人李白,一生好饮。幸好他从不开车。 一天,他提着酒壶,从家里出来,酒壶中有酒 2 斗。他边走边唱: > 无事街上走,提壶去打酒。 > 逢店加一倍,遇花喝一斗。 这一路上,他一共遇到店 N 次,遇到花 M 次。已知最 阅读全文 »
posted @ 2023-07-30 23:27 o-Sakurajimamai-o 阅读(105) 评论(0) 推荐(0) 编辑
摘要://测试1 //[蓝桥杯 2022 省 B] 砍竹子 //计算出所有竹子砍到还剩一下的次数,然后取最大值,只需要循环这个最大值 //由于是从最大值开始循环的,所以所有的次数都能被计算上 //如果此时你需要砍,接下来判断后面的竹子有没有和你等高的,然后砍去; #include<bits/stdc++. 阅读全文 »
posted @ 2023-07-30 23:24 o-Sakurajimamai-o 阅读(16) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10,mod=1e9+7; string s; int n,t,a[N],f[N],res,num,ans,m; bool vis[ 阅读全文 »
posted @ 2023-07-30 01:49 o-Sakurajimamai-o 阅读(16) 评论(0) 推荐(0) 编辑
摘要:# 多层感知机 # 获取数据 import d2lzh from mxnet import autograd batch_size = 256 train_data, test_data = d2lzh.load_data_fashion_mnist(batch_size) # 读入数据 from 阅读全文 »
posted @ 2023-07-29 17:02 o-Sakurajimamai-o 阅读(16) 评论(0) 推荐(0) 编辑
摘要:# 模型选择 欠拟合与过拟合 # 创建数据集 from mxnet import autograd from mxnet import ndarray as nd from mxnet import gluon num_train = 100 num_tset = 100 true_w = [1.2 阅读全文 »
posted @ 2023-07-29 17:02 o-Sakurajimamai-o 阅读(15) 评论(0) 推荐(0) 编辑
摘要:# [TJOI2007] 线段 ## 题目描述 在一个 n×n 的平面上,在每一行中有一条线段,第 i 行的线段的左端点是(i,Li),右端点是(i,Ri)。 你从 (1,1) 点出发,要求沿途走过所有的线段,最终到达 (n,n) 点,且所走的路 阅读全文 »
posted @ 2023-07-29 15:14 o-Sakurajimamai-o 阅读(9) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10,mod=80112002; int e[N],ne[N],idx,f[N],h[N],n,m,a,b,res; bool vis 阅读全文 »
posted @ 2023-07-27 23:45 o-Sakurajimamai-o 阅读(8) 评论(0) 推荐(0) 编辑
摘要:# 多类->线性回归 from mxnet import gluon from mxnet import ndarray as nd import matplotlib.pyplot as plt def transform(data, label): return data.astype('flo 阅读全文 »
posted @ 2023-07-27 16:14 o-Sakurajimamai-o 阅读(33) 评论(0) 推荐(0) 编辑
摘要:Tracking Segments You are given an array a consisting of n zeros. You are also given a set of m not necessarily different segments. Each s 阅读全文 »
posted @ 2023-07-27 11:19 o-Sakurajimamai-o 阅读(24) 评论(0) 推荐(0) 编辑
摘要:# 数据结构,矩阵 # http://zh.gluon.ai/chapter_prerequisite/ndarray.html from mxnet import ndarray as nd print(nd.zeros((3, 4))) # 创建3x4的0矩阵 x = nd.ones((3, 4 阅读全文 »
posted @ 2023-07-26 13:23 o-Sakurajimamai-o 阅读(7) 评论(0) 推荐(0) 编辑
摘要:# Diverse Substrings ## 题面翻译 定义一个数字串是**多变的**当且仅当其中所有数字的重复次数均不超过其中不同数字的种类数。 给定一个由 09 组成的长为 n 的数字串 s,求其不同的**多变的**子串 s[l,r] 的个数。 ## 题目描述 阅读全文 »
posted @ 2023-07-24 11:20 o-Sakurajimamai-o 阅读(10) 评论(0) 推荐(0) 编辑
摘要:数字三角形 #include <bits/stdc++.h> //#define int long long using namespace std; const int N=1e4+10,mod=1e9+7; string s; int n,t,a[N][N],f[N][N],res,num,an 阅读全文 »
posted @ 2023-07-22 19:49 o-Sakurajimamai-o 阅读(6) 评论(0) 推荐(0) 编辑
摘要://单点修改查询 //http://ybt.ssoier.cn:8088/problem_show.php?pid=1549 //https://www.luogu.com.cn/problem/P1198 //用一维数组来存,当作完全二叉树来存 #include<bits/stdc++.h> us 阅读全文 »
posted @ 2023-07-22 11:46 o-Sakurajimamai-o 阅读(7) 评论(0) 推荐(0) 编辑
摘要:Ice and Fire time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little09 and his friends are 阅读全文 »
posted @ 2023-07-22 10:26 o-Sakurajimamai-o 阅读(10) 评论(0) 推荐(0) 编辑
摘要:# Subsequence Addition (Hard Version) ## 题面翻译 本题为困难版,两题的唯一区别在于数据范围的大小。 数列 a 最开始只有一个数 1,你可以进行若干次操作,每次操作你可以选取 k 个数(k 无限制,小于等于 a 的大小即可),将这 k 阅读全文 »
posted @ 2023-07-22 10:25 o-Sakurajimamai-o 阅读(22) 评论(0) 推荐(0) 编辑
摘要://树状数组 //利用lowbit函数将区间划分为以二进制结尾的长度的小区间,然后利用这些小区间相加,减少时间复杂度 //树状数组的本质就是前缀和+可修改区间,求单点前缀和,如果是求某一的区间和,需要稍加修改,下面有类似例题,维护前缀和还有i*前缀和就可以 //也就是说树状数组就是更快一点的前缀和, 阅读全文 »
posted @ 2023-07-20 14:54 o-Sakurajimamai-o 阅读(2) 评论(0) 推荐(0) 编辑
摘要://A //如果两者的距离是奇数的话,那就追不上,如果是偶数,那就追的上 //因为偶数是与小明同类型的位置,只需要把小明逼到墙角就可以了 //可以画一个九宫格,然后把9x9的格子分两种颜色染上,一开始在相同颜色的格子一定会相遇 #include <bits/stdc++.h> #define int 阅读全文 »
posted @ 2023-07-20 10:11 o-Sakurajimamai-o 阅读(13) 评论(0) 推荐(0) 编辑
摘要:# 逛画展 ## 题目描述 博览馆正在展出由世上最佳的 m 位画家所画的图画。 游客在购买门票时必须说明两个数字,ab,代表他要看展览中的第 a 幅至第 b 幅画(包含 a,b)之间的所有图画,而门票的价钱就是一张图画一元。 Sept 希望入场后可以看到所有名师的图画。 阅读全文 »
posted @ 2023-07-19 17:22 o-Sakurajimamai-o 阅读(23) 评论(0) 推荐(0) 编辑
摘要:# 不需要定义变量 # # while循环: # while 条件 : # xxx # xxx # for 循环: # for 临时变量 in 范围容器(可用range,如果是容器的话,就是遍历,如果in 10,就是遍历0-10) # for循环的范围是大于等于第一个小于最后一个,也就是 int i 阅读全文 »
posted @ 2023-07-17 18:26 o-Sakurajimamai-o 阅读(16) 评论(0) 推荐(1) 编辑
摘要:// 1.数列分段 Section I //用last记录前面总和不小于m的值,如果当前值+last>m,说明last区间的为一组,然后开一个新的组 //时间复杂度o(n) #include <bits/stdc++.h> #define int long long using namespace 阅读全文 »
posted @ 2023-07-16 21:31 o-Sakurajimamai-o 阅读(9) 评论(0) 推荐(0) 编辑
摘要:# Hamiltonian Wall ## 题面翻译 给你一个 2×m 的矩阵,矩阵中只可能包含字符 `B` 和 `W`。每一列都有字符 `B`。问能否找出一条路径,满足: - 路径中相邻两格有公共边(只有公共点的不算)。- 每个 `B` 格恰好被覆盖一次。- 每个 `W` 格都没有 阅读全文 »
posted @ 2023-07-13 19:13 o-Sakurajimamai-o 阅读(26) 评论(0) 推荐(0) 编辑
摘要:# Notepad# ## 题面翻译 ### 题目描述 一开始打出的内容为空。现在你要打出一个长度为 n 的字符串 s(全为英文小写字母组成),为此每次你可以进行如下操作中的一种: - 在已打出内容的最后添加一个字符。- 复制已打出内容的一个连续的子串并加到内容的末尾。 问你能不能在严格小于 阅读全文 »
posted @ 2023-07-13 19:12 o-Sakurajimamai-o 阅读(32) 评论(0) 推荐(0) 编辑
摘要:Come Together time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Bob and Carol hanged out w 阅读全文 »
posted @ 2023-07-12 15:50 o-Sakurajimamai-o 阅读(32) 评论(0) 推荐(0) 编辑
摘要:Strong Password time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Monocarp finally got the 阅读全文 »
posted @ 2023-07-12 15:46 o-Sakurajimamai-o 阅读(63) 评论(0) 推荐(0) 编辑
摘要:Apple Tree time limit per test 4 seconds memory limit per test 512 megabytes input standard input output standard output Timofey has an apple tree gro 阅读全文 »
posted @ 2023-07-11 15:40 o-Sakurajimamai-o 阅读(43) 评论(0) 推荐(0) 编辑
摘要:Sum in Binary Tree time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya really likes mat 阅读全文 »
posted @ 2023-07-11 15:39 o-Sakurajimamai-o 阅读(58) 评论(0) 推荐(0) 编辑
摘要:Long Long 题面翻译 题目描述给出一个包含 n 个数字的数列 a。你可以执行任意次操作,每次操作可以更改 [l, r] 范围内的正负性(正数变负,负数变正,0 不变)。你要使得数列每个元素之和尽量大,问最小的操作次数。 多组询问。 输入格式第一行一个整数 T,表示询问组数。 每一 阅读全文 »
posted @ 2023-07-11 15:36 o-Sakurajimamai-o 阅读(33) 评论(0) 推荐(0) 编辑
摘要:Lamps 题面翻译 有 n 盏灯,每盏灯有不亮,亮,坏掉 3 种状态。一开始每盏灯都不亮。 第 i 盏灯有属性 ai,bi。每次操作你可以选择一盏灭的灯将其点亮,并得到 bi 的分数。 每次操作结束后,记有 x 盏灯亮着,则所有 aix 的灯 i 都会 阅读全文 »
posted @ 2023-07-10 18:23 o-Sakurajimamai-o 阅读(85) 评论(0) 推荐(0) 编辑
摘要:# Contrast Value ## 题面翻译 定义序列 a1,a2,,an 的权值是|a1a2|+|a2a3|++|an1an|T 次询问,每次给一个序列 a ,一个 a 的子序列 b 合法当且仅当 b 权值和 $ 阅读全文 »
posted @ 2023-07-10 18:16 o-Sakurajimamai-o 阅读(19) 评论(0) 推荐(0) 编辑
摘要:Maximum Sum time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an array a1,a2 阅读全文 »
posted @ 2023-07-10 18:15 o-Sakurajimamai-o 阅读(21) 评论(0) 推荐(0) 编辑

-- --
点击右上角即可分享
微信分享提示