Codeforces Round 942 (Div. 2) ----- A ----- F --- 题解

前情提要:因为数学水平原因,没法给出e的证明,因为我也是举例归类得出的结论,但是按理来说应该可以利用生成数函数证明

f题也是因为数学原因加上水平有限,我的理解可能有偏差。

目录

A. Contest Proposal:

题目大意:

思路解析:

代码实现:

 B. Coin Games:

题目大意:

思路解析:

代码实现:

C. Permutation Counting:

题目大意:

思路解析:

代码实现:

D1. Reverse Card (Easy Version):

题目大意:

思路解析:

代码实现:

D2. Reverse Card (Hard Version):

题目大意:

思路解析:

代码实现:

E. Fenwick Tree:

题目大意:

思路解析:

 代码实现:

F. Long Way to be Non-decreasing:

题目大意:

思路解析:

代码实现:


A. Contest Proposal:

题目大意:

思路解析:

现在求使得对于所有i中,ai<=bi,最少需要插入几个新的问题,这里一眼贪心即可。

代码实现:

import java.util.*;import java.io.*;public class Main {public static void main(String[] args) throws IOException {int t = f.nextInt();while (t > 0) {solve();t--;}w.flush();w.close();}static int mod = 998244353;static long inf = (long) 1e18;public static void solve() throws IOException {int n = f.nextInt();int[] a = new int[n];int[] b= new int[n];for (int i = 0; i < n; i++) {a[i] = f.nextInt();}for (int i = 0; i < n; i++) {b[i] = f.nextInt();}int p = 0;int ans = 0;for (int i = 0; i < n; i++) {if (a[p] <= b[i]){p++;}else {ans++;}}w.println(ans);}public static void swap(int[] a, int i, int j) {int tmp = a[i];a[i] = a[j];a[j] = tmp;}public static long qkm(long a, long b, long mod) {long res = 1;while (b > 0) {if ((b & 1) == 1) res = res * a % mod;a = a * a % mod;b >>= 1;}return res;}public static class Pair {long x, y;int val;public Pair(long ne, long val, int x) {this.x = ne;this.y = val;this.val = x;}@Overridepublic boolean equals(Object o) {if (this == o) return true;if (o == null || getClass() != o.getClass()) return false;Pair pair = (Pair) o;return x == pair.x && y == pair.y && val == pair.val;}@Overridepublic int hashCode() {return Objects.hash(x, y, val);}}public static class Node {int x, y, val;public Node(int x, int y, int val) {this.x = x;this.y = y;this.val = val;}public Node(int x, int y) {this.x = x;this.y = y;}}static PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out));static Input f = new Input(System.in);static class Input {public BufferedReader reader;public StringTokenizer tokenizer;public Input(InputStream stream) {reader = new BufferedReader(new InputStreamReader(stream), 32768);tokenizer = null;}public String next() throws IOException {while (tokenizer == null || !tokenizer.hasMoreTokens()) {tokenizer = new StringTokenizer(reader.readLine());}return tokenizer.nextToken();}public String nextLine() throws IOException {String str = null;str = reader.readLine();return str;}public int nextInt() throws IOException {return Integer.parseInt(next());}public long nextLong() throws IOException {return Long.parseLong(next());}public Double nextDouble() throws IOException {return Double.parseDouble(next());}}
}

 B. Coin Games:

题目大意:

思路解析:

考虑所有可能的操作:

  • ...UUU...->...DD......:U 的个数减少 3 。
  • ...UUD...->...DU...:U 的数量减少 1 。
  • ...DUU...->...UD...:U 的数量减少 1 。
  • ...DUD... -> ...UU...:U 的数量增加 1 

当U的个数为0时,当前棋手输,可以发现对于所有可能的操作,任意一种情况都会改变U的个数的奇偶性,那么可以得出结论,当初始情况U的个数为奇数时,Alice将赢得游戏。

代码实现:


import java.util.*;import java.io.*;public class Main {public static void main(String[] args) throws IOException {int t = f.nextInt();while (t > 0) {solve();t--;}w.flush();w.close();}static int mod = 998244353;static long inf = (long) 1e18;public static void solve() throws IOException {int n = f.nextInt();char[] s = f.next().toCharArray();int cnt = 0;for (int i = 0; i < n; i++) {if (s[i] == 'U') cnt ^= 1;}if (cnt == 1) w.println("YES");else w.println("NO");}public static void swap(int[] a, int i, int j) {int tmp = a[i];a[i] = a[j];a[j] = tmp;}public static long qkm(long a, long b, long mod) {long res = 1;while (b > 0) {if ((b & 1) == 1) res = res * a % mod;a = a * a % mod;b >>= 1;}return res;}public static class Pair {long x, y;int val;public Pair(long ne, long val, int x) {this.x = ne;this.y = val;this.val = x;}@Overridepublic boolean equals(Object o) {if (this == o) return true;if (o == null || getClass() != o.getClass()) return false;Pair pair = (Pair) o;return x == pair.x && y == pair.y && val == pair.val;}@Overridepublic int hashCode() {return Objects.hash(x, y, val);}}public static class Node {int x, y, val;public Node(int x, int y, int val) {this.x = x;this.y = y;this.val = val;}public Node(int x, int y) {this.x = x;this.y = y;}}static PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out));static Input f = new Input(System.in);static class Input {public BufferedReader reader;public StringTokenizer tokenizer;public Input(InputStream stream) {reader = new BufferedReader(new InputStreamReader(stream), 32768);tokenizer = null;}public String next() throws IOException {while (tokenizer == null || !tokenizer.hasMoreTokens()) {tokenizer = new StringTokenizer(reader.readLine());}return tokenizer.nextToken();}public String nextLine() throws IOException {String str = null;str = reader.readLine();return str;}public int nextInt() throws IOException {return Integer.parseInt(next());}public long nextLong() throws IOException {return Long.parseLong(next());}public Double nextDouble() throws IOException {return Double.parseDouble(next());}}
}

C. Permutation Counting:

题目大意:

 

思路解析:

这里可以发现能组成排列数的个数肯定与1-n中最少的那个数字相等。

假如 1的个数为3  2的个数为2  3的个数为3,那么肯定可以组成 1 2 3 1 2 3此时排列数为4,1 2 3两个2 3 1一个3 1 2一个,那么我们想剩下的1 和 3是否能再组成新的排列数,答案是可以的,

1 3 2 1 3 2 1 3此时 1 3 2 两个 3 2 1两个 2 1 3两个,此时已经最优了,

那么可以发现答案等于 min + (min-1)*(n-1)+ min(n-1,more+k),k可以提高min的大小

代码实现:


import java.util.*;import java.io.*;public class Main {public static void main(String[] args) throws IOException {int t = f.nextInt();while (t > 0) {solve();t--;}w.flush();w.close();}static int mod = 998244353;static long inf = (long) 1e18;public static void solve() throws IOException {int n = f.nextInt(); long k = f.nextLong();long[] a = new long[n];for (int i = 0; i < n; i++) {a[i] = f.nextLong();}int j = 1;Arrays.sort(a);long min = a[0];while (true){if (k < j) break;if (j < n){if ((a[j] - min) * j > k){min += k / j;k %= j;break;}else {k -= (a[j] - min) * j;min = a[j];j++;}}else {min += k / j;k %= j;break;}}if (j == n){long ans = min + (min - 1) * (n - 1) + k;w.println(ans);}else {int cnt = 0;for (int i = j; i < n; i++) {if (a[i] > min) cnt++;}long ans = min + (min - 1) * (n - 1) + Math.min(n - 1, cnt + k);w.println(ans);}}public static void swap(int[] a, int i, int j) {int tmp = a[i];a[i] = a[j];a[j] = tmp;}public static long qkm(long a, long b, long mod) {long res = 1;while (b > 0) {if ((b & 1) == 1) res = res * a % mod;a = a * a % mod;b >>= 1;}return res;}public static class Pair {long x, y;int val;public Pair(long ne, long val, int x) {this.x = ne;this.y = val;this.val = x;}@Overridepublic boolean equals(Object o) {if (this == o) return true;if (o == null || getClass() != o.getClass()) return false;Pair pair = (Pair) o;return x == pair.x && y == pair.y && val == pair.val;}@Overridepublic int hashCode() {return Objects.hash(x, y, val);}}public static class Node {int x, y, val;public Node(int x, int y, int val) {this.x = x;this.y = y;this.val = val;}public Node(int x, int y) {this.x = x;this.y = y;}}static PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out));static Input f = new Input(System.in);static class Input {public BufferedReader reader;public StringTokenizer tokenizer;public Input(InputStream stream) {reader = new BufferedReader(new InputStreamReader(stream), 32768);tokenizer = null;}public String next() throws IOException {while (tokenizer == null || !tokenizer.hasMoreTokens()) {tokenizer = new StringTokenizer(reader.readLine());}return tokenizer.nextToken();}public String nextLine() throws IOException {String str = null;str = reader.readLine();return str;}public int nextInt() throws IOException {return Integer.parseInt(next());}public long nextLong() throws IOException {return Long.parseLong(next());}public Double nextDouble() throws IOException {return Double.parseDouble(next());}}
}

D1. Reverse Card (Easy Version):

题目大意:

思路解析:

a+b是b*gcd(a,b)的倍数,如果gcd(a,b) == 1 ,那么就是 a+b 是b的倍数,那么可以推出a是b的倍数,与gcd(a,b)==1违背

a+b是b*gcd(a,b)的倍数 也可以等价于a+b是b的倍数 等价于 a是b的倍数,那么 a+b应该是b*b的倍数

令 a+b == b*b a+b == 2*b*b................... a == (b-1)*b

只要a和b有这样的关系就可以称为一个有序数对,那么利用这个关系也可以求解答案了 这里在求解时可以等价n中有多少个数是 (b-1)*b的倍数

代码实现:


import java.util.*;import java.io.*;public class Main {public static void main(String[] args) throws IOException {int t = f.nextInt();while (t > 0) {solve();t--;}w.flush();w.close();}static int mod = 998244353;static long inf = (long) 1e18;public static void solve() throws IOException {int n = f.nextInt(); int m = f.nextInt();long ans = n;for (int i = 2; i <= m; i++) {int t = i * (i - 1);if (t > n) break;ans += (n - t) / (i * i) + 1;}w.println(ans);}public static void swap(int[] a, int i, int j) {int tmp = a[i];a[i] = a[j];a[j] = tmp;}public static long qkm(long a, long b, long mod) {long res = 1;while (b > 0) {if ((b & 1) == 1) res = res * a % mod;a = a * a % mod;b >>= 1;}return res;}public static class Pair {long x, y;int val;public Pair(long ne, long val, int x) {this.x = ne;this.y = val;this.val = x;}@Overridepublic boolean equals(Object o) {if (this == o) return true;if (o == null || getClass() != o.getClass()) return false;Pair pair = (Pair) o;return x == pair.x && y == pair.y && val == pair.val;}@Overridepublic int hashCode() {return Objects.hash(x, y, val);}}public static class Node {int x, y, val;public Node(int x, int y, int val) {this.x = x;this.y = y;this.val = val;}public Node(int x, int y) {this.x = x;this.y = y;}}static PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out));static Input f = new Input(System.in);static class Input {public BufferedReader reader;public StringTokenizer tokenizer;public Input(InputStream stream) {reader = new BufferedReader(new InputStreamReader(stream), 32768);tokenizer = null;}public String next() throws IOException {while (tokenizer == null || !tokenizer.hasMoreTokens()) {tokenizer = new StringTokenizer(reader.readLine());}return tokenizer.nextToken();}public String nextLine() throws IOException {String str = null;str = reader.readLine();return str;}public int nextInt() throws IOException {return Integer.parseInt(next());}public long nextLong() throws IOException {return Long.parseLong(next());}public Double nextDouble() throws IOException {return Double.parseDouble(next());}}
}

D2. Reverse Card (Hard Version):

题目大意:

思路解析:

将 gcd(𝑎,𝑏) 表示为 d 。假设有 a=pd𝑎=𝑝𝑑 和 b=qd𝑏=𝑞𝑑 ,那么我们知道 gcd(p,q)=1

(a+b)∣(b⋅gcd(a,b))⟺(pd+qd)∣(qd2)⟺(p+q)∣(qd)

我们知道 gcd(p+q,q)=gcd(p,q)=1,所以是 (p+q)∣d(𝑝+𝑞)∣𝑑 。

我们还知道 p≥1,q≥1 ,所以 p<d=ap≤np ,从而 p2<n 。同样,我们可以证明 q2<m 。

这里有个很关键的地方就是打表,你利用100 1233这组数据就可以找到所有合法有序对(因为这组数据遍历时间并不复杂,并且又有几百的有效有序对,那么对于我们观察答案性质是很有效的)

那我们就可以得到很多对 a 和 b,此时再观察 a/gcd(a,b) ==p, b/gcd(a,b)==q,并且统计这样序关系出现次数,发现他们的出现次数刚好可以等价于 min(n/p,m/q)/(p+q), 那么得到这个式子后就可以进行求解,打表对于构造题和数学题这类题型是非常关键的。

代码实现:


import java.util.*;import java.io.*;public class Main {public static void main(String[] args) throws IOException {int t = f.nextInt();while (t > 0) {solve();t--;}w.flush();w.close();}static int mod = 998244353;static long inf = (long) 1e18;public static void solve() throws IOException {int n = f.nextInt(); int m = f.nextInt();long ans = 0;for (int i = 1; i <= m; i++) {for (int j = 1; j <= m; j++) {if (j * (i + j) > n) break;if (gcd(i, j) == 1){ans += Math.min(m/i,n/j)/(i+j);}}}w.println(ans);}public static int gcd(int i, int j){if(i == 0) return j;if (j==0) return i;return gcd(j, i % j);}public static void swap(int[] a, int i, int j) {int tmp = a[i];a[i] = a[j];a[j] = tmp;}static long pow(long a, long b){long res = 1;while (b > 0){if ((b & 1) == 1) res = res * a % mod;a = a * a % mod;b >>=1;}return res;}public static long qkm(long a, long b, long mod) {long res = 1;while (b > 0) {if ((b & 1) == 1) res = res * a % mod;a = a * a % mod;b >>= 1;}return res;}public static class Pair {long x, y;int val;public Pair(long ne, long val, int x) {this.x = ne;this.y = val;this.val = x;}@Overridepublic boolean equals(Object o) {if (this == o) return true;if (o == null || getClass() != o.getClass()) return false;Pair pair = (Pair) o;return x == pair.x && y == pair.y && val == pair.val;}@Overridepublic int hashCode() {return Objects.hash(x, y, val);}}public static class Node {int x, y, val;public Node(int x, int y, int val) {this.x = x;this.y = y;this.val = val;}public Node(int x, int y) {this.x = x;this.y = y;}}static PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out));static Input f = new Input(System.in);static class Input {public BufferedReader reader;public StringTokenizer tokenizer;public Input(InputStream stream) {reader = new BufferedReader(new InputStreamReader(stream), 32768);tokenizer = null;}public String next() throws IOException {while (tokenizer == null || !tokenizer.hasMoreTokens()) {tokenizer = new StringTokenizer(reader.readLine());}return tokenizer.nextToken();}public String nextLine() throws IOException {String str = null;str = reader.readLine();return str;}public int nextInt() throws IOException {return Integer.parseInt(next());}public long nextLong() throws IOException {return Long.parseLong(next());}public Double nextDouble() throws IOException {return Double.parseDouble(next());}}
}

E. Fenwick Tree:

题目大意:

思路解析:

给出官方题解

 代码实现:


import java.util.*;import java.io.*;public class Main {static int N = (int) 1e6 + 100;static long[] inv = new long[N];public static void main(String[] args) throws IOException {inv[0] = inv[1] = 1;for (int i = 2; i < N; i++) {inv[i] = (mod - mod /i ) * inv[mod % i] % mod;}int t = f.nextInt();while (t > 0) {solve();t--;}w.flush();w.close();}static int mod = 998244353;static long inf = (long) 1e18;public static void solve() throws IOException {int n = f.nextInt(); int m = f.nextInt();long[] a = new long[n+1];for (int i = 1; i <= n; i++) {a[i] = f.nextInt();}for (int i = 1; i <= n; i++) {long mul = 1;for (int j = i + lowbit(i), d=1; j <= n; j+=lowbit(j),++d) {mul = mul * (d + m - 1) % mod * inv[d] % mod;a[j] -= mul * a[i] % mod;a[j] = (a[j] + mod) % mod;}}for (int i = 1; i <= n; i++) {w.print(a[i] + " ");}w.println();}public static int lowbit(int x) {return x & -x;}public static int gcd(int i, int j){if(i == 0) return j;if (j==0) return i;return gcd(j, i % j);}public static void swap(int[] a, int i, int j) {int tmp = a[i];a[i] = a[j];a[j] = tmp;}static long pow(long a, long b){long res = 1;while (b > 0){if ((b & 1) == 1) res = res * a % mod;a = a * a % mod;b >>=1;}return res;}public static long qkm(long a, long b, long mod) {long res = 1;while (b > 0) {if ((b & 1) == 1) res = res * a % mod;a = a * a % mod;b >>= 1;}return res;}public static class Pair {long x, y;int val;public Pair(long ne, long val, int x) {this.x = ne;this.y = val;this.val = x;}@Overridepublic boolean equals(Object o) {if (this == o) return true;if (o == null || getClass() != o.getClass()) return false;Pair pair = (Pair) o;return x == pair.x && y == pair.y && val == pair.val;}@Overridepublic int hashCode() {return Objects.hash(x, y, val);}}public static class Node {int x, y, val;public Node(int x, int y, int val) {this.x = x;this.y = y;this.val = val;}public Node(int x, int y) {this.x = x;this.y = y;}}static PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out));static Input f = new Input(System.in);static class Input {public BufferedReader reader;public StringTokenizer tokenizer;public Input(InputStream stream) {reader = new BufferedReader(new InputStreamReader(stream), 32768);tokenizer = null;}public String next() throws IOException {while (tokenizer == null || !tokenizer.hasMoreTokens()) {tokenizer = new StringTokenizer(reader.readLine());}return tokenizer.nextToken();}public String nextLine() throws IOException {String str = null;str = reader.readLine();return str;}public int nextInt() throws IOException {return Integer.parseInt(next());}public long nextLong() throws IOException {return Long.parseLong(next());}public Double nextDouble() throws IOException {return Double.parseDouble(next());}}
}

F. Long Way to be Non-decreasing:

题目大意:

思路解析:

代码实现:

#include <bits/stdc++.h>namespace FastIO {template <typename T> inline T read() { T x = 0, w = 0; char ch = getchar(); while (ch < '0' || ch > '9') w |= (ch == '-'), ch = getchar(); while ('0' <= ch && ch <= '9') x = x * 10 + (ch ^ '0'), ch = getchar(); return w ? -x : x; }template <typename T> inline void write(T x) { if (!x) return; write<T>(x / 10), putchar(x % 10 ^ '0'); }template <typename T> inline void print(T x) { if (x < 0) putchar('-'), x = -x; else if (x == 0) putchar('0'); write<T>(x); }template <typename T> inline void print(T x, char en) { if (x < 0) putchar('-'), x = -x; else if (x == 0) putchar('0'); write<T>(x), putchar(en); }
}; using namespace FastIO;#define MAXM 1000001
int dep[MAXM], id[MAXM], dfn[MAXM], to[MAXM], sz[MAXM], tot = 0;
std::vector<int> ch[MAXM];
void dfs(int u) {sz[u] = 1, dfn[u] = ++tot;for (int v : ch[u]) {dep[v] = dep[u] + 1, id[v] = id[u];dfs(v), sz[u] += sz[v];}
}
inline bool inSub(int u, int v) /* v \in u ? */ { return dfn[u] <= dfn[v] && dfn[v] < dfn[u] + sz[u]; }
constexpr int INF = 0x3f3f3f3f;
inline int query(int u, int v) /* u -> v */ {if (u == v) return 0;if (id[u] != id[v]) return INF;int res = INF;if (inSub(v, u)) res = dep[u] - dep[v];if (inSub(v, to[id[u]])) res = std::min(dep[u] - dep[v] + dep[to[id[u]]] + 1, res);// printf("query(%d, %d) = %d\n", u, v, res);return res;
}#define MAXN 1000001
int a[MAXN], N, M;
bool check(int val) {// printf("check %d\n", val);int lst = 1;for (int i = 1; i <= N; ++i) {while (lst <= M && query(a[i], lst) > val) ++lst;if (lst > M) return false;// printf("a[%d] = %d\n", i, lst);	}return true;
}namespace DSU {int fa[MAXM];void inis(int n) { for (int i = 1; i <= n; ++i) fa[i] = i; }inline int find(int x) { return x == fa[x] ? x : fa[x] = find(fa[x]); }inline bool merge(int x, int y) { if (find(x) == find(y)) return false; fa[fa[x]] = fa[y]; return true; }
}; using namespace DSU;int main() {int T = read<int>();while (T--) {N = read<int>(), M = read<int>(), inis(M);for (int i = 1; i <= N; ++i) a[i] = read<int>();for (int x = 1; x <= M; ++x) dep[x] = id[x] = dfn[x] = to[x] = sz[x] = 0, ch[x].clear();tot = 0;for (int i = 1, p; i <= M; ++i) {p = read<int>();if (merge(i, p)) ch[p].push_back(i); else to[i] = p;}for (int i = 1; i <= M; ++i) if (to[i] > 0) id[i] = i, dfs(i);if (!check(M)) { puts("-1"); continue; }int L = 0, R = M;while (L < R) {int mid = L + R >> 1;if (check(mid)) R = mid; else L = mid + 1;}print<int>(R, '\n');}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/5723.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

图像处理的一些操作(1)

图像处理 1.安装PIL&#xff0c;skimage库1.1导入skimage库中的oi模块和data模块 2.读取图像文件2.1读取图像文件2.2 以灰度模式读取图像2.3 查看示例图像的目录路径2.4 读取chelsea图片2.5 加载示例图片并保存2.6 获得加载图片的信息2.6.1 输出图片类型2.6.2 输出图片尺寸2.6.…

MySQL数据库练习(17)

schooldb库——utf8字符集——utf8_general_ci排序规则 81. DDL CREATE TABLE styles (id int(11) NOT NULL AUTO_INCREMENT COMMENT 自增ID,styleSys varchar(20) DEFAULT NULL COMMENT 系统类型(home:PC),styleName varchar(255) NOT NULL COMMENT 风格名称,styleAuthor va…

企业网站必看——企业级OV SSL证书详细介绍

组织验证&#xff08;Organization Validation&#xff0c;简称OV&#xff09;SSL证书作为网络安全解决方案的重要组成部分&#xff0c;通过提供中级的安全保障和增强的网站身份验证&#xff0c;有效提升了网站的安全级别与用户信赖度。本文将深入探讨OV SSL证书的工作原理、申…

面试:Spring(IOC、AOP、事务失效、循环引用、SpringMVC、SpringBoot的自动配置原理、Spring框架常见注解)

目录 一、Spring的单例Bean是否是线程安全的&#xff1f; 二、什么是AOP 1、介绍 &#xff08;1&#xff09;记录操作日志 &#xff08;2&#xff09;实现Spring中的事务 三、spring中事务失效的场景有哪些&#xff1f; 1、异常捕获处理 2、抛出检查异常 3、非public方…

香港Web3,步履蹒跚

4月30日&#xff0c;6支香港虚拟资产现货ETF在香港交易所敲钟上市&#xff0c;正式迎来市场首秀。 而在前一周&#xff0c;香港证监会&#xff08;SFC&#xff09;官网就已列出华夏基金(香港)、博时国际和嘉实国际三家基金公司的比特币和以太坊现货ETF&#xff0c;并陆续披露了…

[ log日志画图]分割模型训练结束生成相关日志运用代码画图

文章目录 [ log日志画图]分割模型训练结束生成相关日志运用代码画图我的log文件&#xff1a;画图&#xff1a;1.loss1.1 loss是干嘛的1.2 代码1.3 生成图 2.DICE.IOU2.1 DICE,IOU是干嘛的(常规介绍)2.2 代码2.3 生成图小白tip [ log日志画图]分割模型训练结束生成相关日志运用代…

python 怎么调用R

如何在python中调用R&#xff1f;这其中包括了如何调用R的对象&#xff08;函数和包&#xff09;&#xff0c;R和python的对象如何互相转换&#xff0c;以及如何调用R的脚本&#xff08;外界参数的输入&#xff09;。python提供了一个模块rpy2&#xff0c;可以较好地完成这项工…

关于海康相机和镜头参数的记录

对比MV-CS020-10UC和大家用的最多的MV-CS016-10UC 其实前者适合雷达站使用&#xff0c;后者适合自瞄使用 一&#xff1a;MV-CS020-10UC的参数 二&#xff1a;对比 三&#xff1a;海康镜头选型工具

Java 基础重点知识-(泛型、反射、注解、IO)

文章目录 什么是泛型? 泛型有什么用?泛型原理是什么? Java 反射什么是反射? 反射作用是什么?动态代理有几种实现方式? 有什么特点? Java 注解什么是注解, 作用是什么? Java I/O什么是序列化?Java 是怎么实现系列化的?常见的序列化协议有哪些?BIO/NIO/AIO 有什么区别…

面试八股——HashMap

实现原理 红黑树是为了解决链表过长之后&#xff0c;查找时间过长的问题&#xff0c;将链表存储变为红黑树存储。 put方法的实现&#xff08;5⭐&#xff09; 相关属性&#xff1a; 1. 容量&#xff1a;初始容量为2^4。 2. 加载因子&#xff1a;初始值为0.75 上面两个属性的…

【面试经典 150 | 回溯】单词搜索

文章目录 写在前面Tag题目来源解题思路方法一&#xff1a;回溯 写在最后 写在前面 本专栏专注于分析与讲解【面试经典150】算法&#xff0c;两到三天更新一篇文章&#xff0c;欢迎催更…… 专栏内容以分析题目为主&#xff0c;并附带一些对于本题涉及到的数据结构等内容进行回顾…

Cloudflare高级防御规则 看看我的网站如何用防御的

网站已趋于稳定&#xff0c;并且经过nginx调优。我想先分享一下Cloudflare的WAF规则&#xff0c;因为这是最有效的防御之一&#xff0c;可以抵御大量恶意攻击流量&#xff0c;我已经验证了数月。 对于海外独立站电商网站&#xff0c;Cloudflare的CDN服务是首选&#xff0c;它强…

1. 深度学习笔记--神经网络中常见的激活函数

1. 介绍 每个激活函数的输入都是一个数字&#xff0c;然后对其进行某种固定的数学操作。激活函数给神经元引入了非线性因素&#xff0c;如果不用激活函数的话&#xff0c;无论神经网络有多少层&#xff0c;输出都是输入的线性组合。激活函数的意义在于它能够引入非线性特性&am…

代谢组数据分析七:从质谱样本制备到MaxQuant搜库

前言 LC-MS/MS Liquid Chromatography-Mass Spectrometry&#xff08;LC-MS/MS &#xff0c;液相色谱-质谱串联&#xff09;可用于残留化合物检测、有机小分子检测、鉴定和定量污染物以及在医药和食品领域添加剂检测和生物小分子等检测。 LC-MS/MS一般包含五个步骤&#xff…

50. 【Android教程】xml 数据解析

xml 是一种标记扩展语言&#xff08;Extension Mark-up Language&#xff09;&#xff0c;学到这里大家对 xml 语言一定不陌生&#xff0c;但是它在 Android 中的运用其实只是冰山一角。抛开 Android&#xff0c;XML 也被广泛运用于各种数据结构中。在运用 xml 编写 Android 布…

HashMap的底层存储介绍

HashMap底层实现采用了哈希表&#xff0c;这是一种非常重要的数据结构。对于我们一行理解很多技术都非常有帮助。 数据结构中由数组和链表来实现对数据的存储&#xff0c;他们各有特点。 &#xff08;1&#xff09;数组&#xff1a;占用空间连续。寻址容易&#xff0c;查询速…

openlayer 使用ol-ext插件实现凸显区域

使用ol-ext插件实现凸显多变形 效果如图 1、创建openlayer var map; var view; var tileLayer, source, vector;function init() {tileLayer new ol.layer.Tile({source: new ol.source.TileArcGISRest({url: "http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStr…

Windows 10 使用 Vagrant 快速创建虚拟机

一、下载 VirtualBox 官网地址&#xff1a;Oracle VM VirtualBox 阿里云盘&#xff1a;阿里云盘分享 二、安装 VirtualBox 安装软件前请先确认 CPU 是否开启了虚拟化&#xff0c;要求开启 2.1、双击运行可执行文件后点击下一步 2.2、选择安装路径&#xff0c;为了避免中文乱码…

Rust Web开发实战:构建高效稳定的服务端应用

如果你厌倦了缓慢、占用大量资源且不稳定的模板化Web开发工具&#xff0c;Rust就是你的解决方案。Rust服务提供了稳定的安全保证、非凡的开发经验&#xff0c;以及能够自动防止常见错误的编译器。 《Rust Web开发》教你使用Rust以及重要的Rust库(如异步运行时的Tokio、用于Web…

OpenFeign修改HttpClient为Apache HttpClient 5

OpenFeign中http client 如果不做特殊配置&#xff0c;OpenFeign默认使用JDK自带的HttpURLConnection发送HTTP请求&#xff0c; 由于默认HttpURLConnection没有连接池、性能和效率比较低。所以修改为Apache HttpClient 5。 总结为两步&#xff1a; 加依赖改yml 具体操作请往…