自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(20)
  • 收藏
  • 关注

原创 RuntimeError: Trying to backward through the graph a second time (or directly access saved tensors a

RuntimeError: Trying to backward through the graph a second time (or directly access saved tensors after they have already been freed). Saved intermediate values of the graph are freed when you call .backward() or autograd.grad(). Specify retain_graph=True

2022-11-03 18:12:13 9019 7

原创 2021北邮软件工程807数一英一,双非一战上岸经验贴

2021北邮软件工程807数一英一,一战上岸经验贴本人情况双非,软件工程专业,六级。数一92,英一64,政治72,807 :125初试我用的教材:数学:张宇30讲,张宇18讲,张宇线代9讲,概率论9讲。李林6套卷,4套卷。张宇真题大全解。张宇1000讲(这一个我没做是因为没时间了,但极力推)。政治:徐涛强化课程,搭配《核心考案》。肖秀荣1000题,8套卷,4套卷。英语:墨墨背单词,真题。807:王道数据结构,王道操作系统。807真题。数学:全程跟张宇,看了张宇30讲,36讲(高数18讲,

2021-07-25 17:02:38 2976 21

原创 PAT A1013 Battle Over Cities(测试点4超时,将输入输出更改即可)

#include <iostream>#include <vector>#include <memory.h>using namespace std;#define maxx 1111int n, m, k;vector<int>G[maxx];int vis[maxx];int now;void DFS(int u){ if (u == now)return; vis[u] = true; for (int i = 0; i &lt

2020-07-23 18:50:42 408

原创 PAT A1094 The Largest Generation (BFS与DFS)

#include <iostream>#include <vector>#include <queue> using namespace std;int n, m;vector<int>s[101];queue<int>q;int deep[101] = { 0 };int dep = 1;int nodelevel[101];void BFS(int root){ q.push(root); nodelevel[root

2020-07-08 11:26:37 117

原创 PAT A1097Deduplication on a Linked List (测试点2)

测试点2应该是重复数字的链表为空,此时不需要输出-1。而如果第一个非重复链表为空,需要输出-1。#include<iostream>#include <algorithm>using namespace std;#define MAX 100010bool isExit[MAX] = {false};struct node{ int add; int key; int next; int flag; int in;};bool cmp(node a, n

2020-07-05 18:52:32 408 1

原创 PAT A1052Linked List Sorting(测试点3:输出首节点地址时也要保证格式)

#include <iostream>#include <iomanip>#include <algorithm>using namespace std;#define MAX 100010struct node{ int add; int key; int next; int flag;};bool cmp(node a, node b){ return a.key < b.key;}int main(){ int n, fir

2020-07-05 14:52:32 342 11

原创 PAT A1051 Pop Sequence(自己实现栈)

#include <iostream>using namespace std;struct stack { int top; int *s;};void Push(stack &x, int i){ x.s[++x.top]= i;}void Pop(stack &x){ int res = x.s[x.top--]; //cout << res<<" ";}int main(){ stack x; int n, k

2020-07-02 15:44:29 155

原创 PAT 1022 Digital Library(测试点3,4是输出格式问题)

#include <iostream>#include <string>#include <map>#include <set>using namespace std;void Find(map<string, set<int>>&list, string &x){ if (list.find(x) == list.end()) cout << "Not Found" << en

2020-07-01 21:05:22 395 3

原创 PATA1071 1071 Speech Patterns (代码与《算法笔记》A1054相似,思路一致)

#include <iostream>#include <map>#include <string>using namespace std;int main(){ string s; getline(cin, s);//先读入整个字符串 map<string, int>count; int i; string str; for (i = 0; i <= s.length(); i++)//这里取“=”保证只输入一个字符时,还可以循环

2020-07-01 19:15:19 91

原创 PAT A1024 Palindromic Number(用vector存储每次数组)

本来用int直接加,测试点5.6.7.8过不了。改为long long int,并用大整数加法后过。#include <iostream>#include <vector>using namespace std;vector<int> A1(vector <int>&s,long long int n){ while (n) {...

2020-05-06 14:12:29 123

原创 PAT A1023 Have Fun with Numbers(测试点2,4,7过不了,不知道为什么)

#include<iostream>#include <string>#include <vector>using namespace std;int main(){ string s; cin >> s; int a[10]{};//统计个数 int i, t = 0; vector<int>ans; int j ...

2020-05-05 16:53:16 699 1

原创 PAT B1017 A除以B(感觉比《算法笔记》上更简单些)

#include<iostream>#include <string>#include <vector>using namespace std;int main(){ string s; cin >> s; int m; cin >> m; int i; int t=0;//余数 vector<int>...

2020-05-05 15:42:51 206 2

原创 PAT A1059 Prime Factors(不用生成质数表,而是每次计算质数因子)

测试点2是一个大数,开始预设数组为s[10],不过。改为s[100]后过。测试点3为1#include <iostream>#include <math.h>using namespace std;int Judge(int n)//判断是否为质数{ int i; if (n < 2)return 0; if (n == 2)return 1; f...

2020-05-05 15:18:00 131

原创 B1034 有理数四则运算

测试点2,将所有int改为long long int后过。#include<iostream>#define INF 100000000using namespace std;struct node{ long long int m; long long int zi; long long int mu;};long long int Gcd(long long i...

2020-05-04 15:39:32 128

原创 PAT A1081 Rational Sum

测试点3不过,后来在每一次计算后都进行化简后过。#include <iostream>using namespace std;struct node{ long long int son; long long int dad;};int Gcd(long long int a,long long int b)//最大公约数{ long long int z=b; ...

2020-05-04 14:28:20 200

原创 PAT A1029 Median

用vector,将两组数据存入一个数组,然后排序,直接输出中间位置的数。可能速度没有《算法笔记》上两个指针快?不过也能全过。#include <iostream>#include <algorithm>#include <vector>using namespace std;int main(){ int n1, n2; cin >&g...

2020-05-02 17:04:27 131

原创 PAT B1035 插入与归并

特别朴实的,写了插入和合并排序算法。然后一遍遍比较,如果与end数组相等,则再运行一遍该排序,然后输出。否则运行另一种排序。#include <iostream>#include <algorithm>using namespace std;int Insert(int first[], int *end, int n){ int *s = new int[...

2020-05-02 16:35:00 115

原创 PAT A1044 Shopping in Mars

用lower_bound二分法找到与i的和大于等于m的下标。然后用sort将sum排序。。最后将最小的和(即差值等于m,或稍大于m)输出即可。#include<iostream>#include <algorithm>using namespace std;struct node{ int a; int b; int sum;};int cmp(no...

2020-05-02 14:34:53 88

原创 【PAT】A1025 PAT Ranking

#include <iostream>#include <algorithm>#include <string>using namespace std;struct node{ string name; int score; int flag; int rank; int ranklocal;};int judge(node a,node...

2020-03-13 13:54:28 91

原创 PAT A1077 Kuchiguse(测试点4未过)

#include <iostream>#include <string>using namespace std;int main(){ int n; int i; cin >> n; getchar(); string a, b; int p, q; int tag = 0; getline(cin, a); for (i = 0; ...

2020-03-12 22:53:22 595 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除