07 2020 档案
摘要:A. Magical Sticks #include <bits/stdc++.h> using namespace std; int T; int main() { scanf("%d", &T); while(T --) { int N; scanf("%d", &N); if(N == 1 |
阅读全文
摘要:Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates. + + + + | Id(INT
阅读全文
摘要:进程与线程的区别进程是 CPU 资源分配的最小单位 进程可以包含多个线程;线程是 CPU 调度的最小单位;一个进程由多个线程组成;线程是一个进程中代码不同的执行路线;进程之间相互独立 但是同一进程下的线程可以共享进程内的资源 JS 数据类型JS 数据类型有 7 种 Number Boolean St
阅读全文
摘要:两个全都由小写字母组成的字符串 s 和 t 判断 s 是不是包含 t 的全排列 #include <bits/stdc++.h> using namespace std; string s, t; int cnts[30], cntt[30]; bool check(string s1, strin
阅读全文
摘要:把数组中所有的奇数放到偶数的左边不在意顺序 #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int N; int a[maxn]; int main() { scanf("%d", &N); for(i
阅读全文
摘要:题意如题 找到 N 个数字中缺少的一个数字 方法 1:求和 算出 1 + 2 + ... + N 的和然后减去数组中 N - 1 个数字的和 int missNum(int N, int a[maxn]) { long long sum = 0; for(int i = 0; i < N - 1;
阅读全文
摘要:看面经的时候看到有洗牌算法的问题 题意就很简单 把 54 张扑克牌进行重排 使每张牌在每个位置上等概率的出现 是个小清新算法了 QAQ #include <bits/stdc++.h> using namespace std; int a[110]; void init() { for(int i
阅读全文