摘要: 解决方案来自https://gist.github.com/plembo/f0767e4fbcd42c6c98f8271c15ee785d?ref=techhut.tv 首先确保宿主机开启了3d加速,并且客户机安装了vmware tools。 编辑~/.vmware/preferences 在最后加 阅读全文
posted @ 2024-07-02 18:39 lightmon 阅读(173) 评论(0) 推荐(0)
摘要: 把/usr/share/applications中的.desktop文件复制到~/.local/share/applications中修改[Exec]栏的参数即可。 阅读全文
posted @ 2024-06-18 13:19 lightmon 阅读(209) 评论(0) 推荐(0)
摘要: 文件拆分脚本 每隔两行拆分成一个新文件。 import os with open('Main.java', 'r', encoding='UTF-8') as file: file_content = file.read() file_parts = file_content.split('\n\n 阅读全文
posted @ 2024-06-17 21:42 lightmon 阅读(62) 评论(0) 推荐(0)
摘要: A. SSeeeeiinngg DDoouubbllee 直接将原字符串翻转一下拼到原字符串的后面就构成了回文串。 string s; void solve() { cin >> s; cout << s; reverse(s.begin(), s.end()); cout << s << '\n' 阅读全文
posted @ 2024-06-15 15:54 lightmon 阅读(53) 评论(0) 推荐(0)
摘要: 对拍器代码 #include <fstream> void solve() { ifstream input1; // 你的代码运行的输出 input1.open("../output.txt"); ifstream input2; // 正确的代码的输出 input2.open("../compa 阅读全文
posted @ 2024-06-13 20:29 lightmon 阅读(49) 评论(0) 推荐(0)
摘要: A. Hossam and Combinatorics \(|a_i - a_j|\)最大的就是最大值和最小值,注意要开long long。 int n; int a[N]; void solve() { cin >> n; int min_v = INF, max_v = 0; for (int 阅读全文
posted @ 2024-06-10 14:26 lightmon 阅读(49) 评论(0) 推荐(0)
摘要: 可能你装的是dkms版本的驱动,这种一般要安装linux内核对应的headers,然后会自动安装模块。 比如,如果你用的是linux-zen,那么只要 sudo pacman -S linux-zen-headers 即可。 阅读全文
posted @ 2024-06-10 02:24 lightmon 阅读(343) 评论(0) 推荐(0)
摘要: A. Absolute Maximization 我们可以选择两个位置\(i, j\)来存放最大值\(a_i\)和最小值\(a_j\),对每一位,如果从\(a_{[1, n]}\)的这一位有\(1\),我们就可以把\(1\)挪到\(a_i\)里,如果这意味有\(0\),我们就可以把\(0\)挪到\( 阅读全文
posted @ 2024-06-08 02:23 lightmon 阅读(58) 评论(0) 推荐(0)
摘要: A. Guess the Maximum 因为\(i < j\),所以所有的\([i, j]\)区间中都至少包含两个相邻元素,所以只要求出所有相邻元素中较大值的最小值即可。 int n; int a[N]; void solve() { cin >> n; int min_v = 1e9 + 1; 阅读全文
posted @ 2024-06-07 11:11 lightmon 阅读(76) 评论(0) 推荐(0)
摘要: A. Turtle and Piggy Are Playing a Game 首先\(p\)选\(2\)的话除得最慢,得的分多。考虑二进制表示,如果\(x = (1000000000)_{bin}\),则每次除以\(2\)都是相当于右移一位,除完之后仍然是\(2\)的倍数,变成\(1\)的步数就是把 阅读全文
posted @ 2024-06-05 14:53 lightmon 阅读(402) 评论(0) 推荐(0)