- 博客(14)
- 收藏
- 关注
转载 Mac 升级 Git 版本
不吹牛的说,这篇文章绝对是目前网上最简单的 Git 升级教程了安装 HomebrewHomebrew 是一个软件包管理器。它的作用就是将软件包安装到自己的目录中,然后将其文件符号链接到 /usr/local。更多信息,请自行进入官网查看。在将下面代码复制进终端,点击回车,然后打开零食,边吃边等就好。/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"升级
2021-03-15 12:43:14 728
原创 7-4 Professional Ability Test (30 分)
#include <algorithm>#include <iostream>#include <queue>#include <unordered_set>#include <vector>using namespace std;struct Node { int T, S; Node() {} Node(int T, int S) : T(T), S(S) {}};bool is_consisten
2021-03-15 10:46:02 844
原创 7-3 Left-View of Binary Tree (25 分)
#include <iostream>#include <queue>#include <vector>using namespace std;struct Node { int val, level; Node *left, *right;};Node *rebuild(vector<int> &in, vector<int> &pre, int inL, int preL, int len, i
2021-03-15 10:45:09 137
原创 7-2 How Many Ways to Buy a Piece of Land (25 分)
#include <iostream>#include <vector>using namespace std;int main() { int N, M; cin >> N >> M; vector<int> prices(N); for (int i = 0; i < N; i++) { cin >> prices[i]; } int ways =
2021-03-15 10:44:22 151
原创 7-1 Panda and PP Milk (20分)
#include <iostream>using namespace std;int w[10005], m[10005];int main() { int n; cin >> n; m[0] = 200; cin >> w[0]; for (int i = 1; i < n; ++i) { cin >> w[i]; // 体重相等 if (w[i]
2021-03-15 10:43:09 131
原创 7-4 Chemical Equation (30 分)
#include <algorithm>#include <iostream>#include <map>#include <queue>#include <string>#include <unordered_set>#include <vector>using namespace std;unordered_set<string> reactants;vector<string&g
2021-03-14 14:08:00 367
原创 7-3 File Path (25 分)
#include <iostream>#include <string>#include <vector>using namespace std;struct Node { string name; vector<Node*> children; Node* parent;};bool dfs(string& id, Node* file, vector<string>& path) { if (file-
2021-03-14 14:07:21 158
原创 7-2 Subsequence in Substring (25 分)
#include <iostream>using namespace std;int main() { string str1, str2; cin >> str1 >> str2; int start = 0, len = str1.length(); for (int i = 0; i < str1.length(); i++) { if (str1[i] == str2[0]) {
2021-03-14 14:06:47 193
原创 7-1 The Closest Fibonacci Number (20 分)
#include <iostream>#include <algorithm>#include <vector>using namespace std;vector<int> gen_fb() { vector<int> fb = {0, 1}; for (int i = 2; fb.back() < 1e8; i++) { fb.push_back(fb[i - 1] + fb[i - 2]);
2021-03-14 14:06:12 135
原创 7-4 Recycling of Shared Bicycles (30 分)
#include <iostream>#include <queue>#include <vector>#include <algorithm>using namespace std;struct Node { int v, d; Node() {} Node(int v, int d) :v(v), d(d) {}};vector<vector<Node>> adj;void dijkstra(int s
2021-03-13 17:32:35 617 5
原创 7-3 Structure of Max-Heap (25 分)
#define _CRT_SECURE_NO_WARNINGS#include <iostream>#include <string>using namespace std;int last = 0;int heap[1005];void insert(int val) { int p = ++last; heap[p] = val; for (; p / 2 >= 1; p /= 2) { if (heap[p] > heap[p / 2]
2021-03-13 17:31:56 415
原创 7-2 Lab Access Scheduling (25 分)
#define _CRT_SECURE_NO_WARNINGS#include <iostream>#include <algorithm>#include <vector>using namespace std;int timestamp(int h, int m, int s) { return s + m * 60 + h * 3600;}int main(){ int n; cin >> n; if (n == 0)
2021-03-13 17:31:26 279
原创 7-1 Arithmetic Progression of Primes (20 分)
#include <iostream>#include <algorithm>using namespace std;bool is_prime[100005];int MAXP, n;int main(){ cin >> n >> MAXP; fill(is_prime + 2, is_prime + 1 + MAXP, true); for (int i = 2; i <= MAXP; i++) { for (int j
2021-03-13 17:30:47 607 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人