摘要: sgns方法加注释 # Defined in Section 5.2.3.3 #基于负采样 import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torc 阅读全文
posted @ 2024-05-27 00:29 漫卷 阅读(1) 评论(0) 推荐(0) 编辑
摘要: C:\Users\漫卷\AppData\Local\Programs\Python\Python38\python.exe C:\Users\漫卷\Desktop\作业\NLP\first_try\Ch03ProcessingText\3.1_cutting_chinese_words_2.py B 阅读全文
posted @ 2024-05-12 22:16 漫卷 阅读(1) 评论(0) 推荐(0) 编辑
摘要: Kahn算法 适用于有向图 算法核心:用一个队列维护一个入度为0度点的集合。 //点数为n,边数为m,din标记入度为0度点,tp为装拓扑序列的数组,mapp为需要传入的图 bool toposort(int& n,vector<int>& din,vector<int>& tp,vector<ve 阅读全文
posted @ 2024-03-24 16:56 漫卷 阅读(3) 评论(0) 推荐(0) 编辑
摘要: AC自动机有两个前置知识点,KMP算法和字典树 KMP算法: KMP(Knuth-Morris-Pratt)算法是一种高效的字符串匹配算法,由Donald Knuth、Vaughan Pratt和James H. Morris于1977年共同发明。KMP算法的核心思想是当字符串不匹配时,能够利用已经 阅读全文
posted @ 2024-03-24 16:16 漫卷 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 比赛地址:https://ac.nowcoder.com/acm/contest/77526 开错题了,赛时就出了5题; 补题顺带写一下记录 A:小苯的区间和疑惑 链接:https://ac.nowcoder.com/acm/contest/77526/A 大意:给一个数组\(a\),让你对数组中每 阅读全文
posted @ 2024-03-20 20:40 漫卷 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 给你一个数组 a1,a2…an 。请计算有多少个图元 (i,j,k,l)符合以下条件: · \(1\) \(\le\) \(i\)<\(j\)<\(k\)\(<\)\(l\)\(\le\)n · a\(i\)\(=\) a\(k\) 和 a\(j\) \(=\) a\(l\) \(Input\) T 阅读全文
posted @ 2024-03-10 21:41 漫卷 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 小红数组操作 题目链接:https://ac.nowcoder.com/acm/contest/74362/D 题目描述 小红拿到了一个数组,初始数组为空,她希望你实现以下两种操作: 1.输入 1 \(x\) \(y\) ,将 \(x\) 插入在元素 \(y\) 的右边。保证此时数组中没有元素等于 阅读全文
posted @ 2024-02-05 15:34 漫卷 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 本周主要学了bfs 简单的说,bfs就是用一个队列和结构体数组,或者多个数组,用队列对查找目标进行遍历,用其他数据结构对查找目标进行标记; 洛谷 P1331 海战 #include<bits/stdc++.h> using namespace std; using ll= long long; co 阅读全文
posted @ 2024-02-01 11:06 漫卷 阅读(26) 评论(0) 推荐(0) 编辑
摘要: M. Gitignore Your git project (you don't need to be familiar with git to solve this problem) has some files that should be ignored from synchronizing. 阅读全文
posted @ 2024-01-28 12:46 漫卷 阅读(18) 评论(0) 推荐(0) 编辑