前言 个人珍藏的80道Java多线程/并发经典面试题,因为篇幅太长,现在先给出1-10的答案解析哈,后面一起完善,并且上传github哈~ ? https://github.com/whx123/JavaHome ? 「公众号:捡田螺的小男孩」 1. synchronized的实现原理以及锁优化? ...
分类:
编程语言 时间:
2020-07-29 10:36:49
阅读次数:
92
题面 #include <bits/stdc++.h> using namespace std; template<typename temp> void read(temp &x){ x = 0; temp f = 1; char ch; while(!isdigit(ch = getchar() ...
分类:
其他好文 时间:
2020-07-28 22:35:46
阅读次数:
61
#ifndef MY_BIGN_H#define MY_BIGN_H 1#pragma GCC system_header#include<cstring>#include<algorithm>#include<iostream>using std::max;using std::istream;u ...
分类:
其他好文 时间:
2020-07-28 16:52:02
阅读次数:
67
/* a是一个3*4的整型数组。函数max_value求最大值max,请编写max_value函数和 main()函数,在main()函数中调用max_value函数求出3*4的整型数组的最大值并输出结果 */ #include <stdio.h> int max_value(int a[][4], ...
分类:
编程语言 时间:
2020-07-28 14:10:10
阅读次数:
68
Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one cha ...
分类:
其他好文 时间:
2020-07-28 14:04:15
阅读次数:
77
###思路 这个题一看到什么从入度为零的点到出度为零的点,很容易想到toposort。这个题就是最基本的toposort+DAG DP,没啥好说的…… 主要注意一定是遇到出度为0的点,一条食物链才能算是结束,才能够累加答案。 Code #include<iostream> #include<cstd ...
分类:
其他好文 时间:
2020-07-28 10:17:55
阅读次数:
75
首先有一些神奇的东西。 有一类问题可以转化成形如$minimize\sum_{u,v} max(h_u-h_v+w_{u,v},0)c_{u,v}$,其中h是任意值 然后这个和最大费用循环流等价,就是u到v连一条$(c_{u,v},w_{u,v})$的边,然后消一下正环,直接跑就完了。。。 有一道例 ...
分类:
其他好文 时间:
2020-07-28 00:23:04
阅读次数:
64
题意 给定一个$6\times n$的方格,每个点有一个非负权值,有两种操作 给定$x,y,c$,表示将坐标为$(x,y)$的格子的权值改为$c$ 给定$x_1,y_1,x_2,y_2$,求出从$(x_1,y_1)$到$(x_2,y_2)$的最短路 $n\le 10^5$ Sol 打表枚举观察可得, ...
分类:
其他好文 时间:
2020-07-28 00:12:03
阅读次数:
66
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0 ...
分类:
移动开发 时间:
2020-07-28 00:01:53
阅读次数:
111
// 1. 数据库数据 // { // "avatar": { // 集合(表名) // "data": [ // 数据 // { // "_id": "1", // "alias": "john", // "region": "asia", // "scores": [40, ...
分类:
数据库 时间:
2020-07-27 23:57:42
阅读次数:
100