黑苹果OS X 10 11 2 驱动基本成功:无休止地挂载、重启换来的回报

此前通过折腾OSX10.9获得了一份较可靠的DSDT代码,但是在装10.11期间试过HP Install Helpler所增补的一些不知其所以然的补丁。
两个版本各有优劣,互不相容。

僵持了一个多月后,最终决定手动模拟“二分查找”来对两份代码进行merge操作。

DiffMerge.app是一款直观便捷的文本比较器(不是编辑器)。

经查,防止Clover引导El Captain分区引导失败和排除关机不断电故障的关键代码如下:

OperationRegion (GNVS, SystemMemory, 0xAC5EEB98, 0x019F)

在搜索解答的过程中还发现了有用的资料库:Clover Wiki

为调试DSDT代码,不辞辛劳地降级、升级,方才发现OSX不同版本驱动USB的方式有明显差别。

pcbeta论坛上某坛友仿冒的AppleHDA.kext虽有扬声器音量控制不同步的bug,但总体上异常完善,填补了该领域的一大空白,且能“向上”兼容。

2015年12月勤奋刻苦的国外开发者RehabMan所编写的GenericUSBXHCI.kext成为了驱动USB3.0端口,以及实现USB端口通信正常化的制胜关键。感激不尽。

注意去除DSDT中所注入的USB fakeID之类的值。

BestCoder

Solved Problems
ZYB’s Biology
ZYB’s Game
ZYB’s Premutation

ZYB’s Biology

平淡无奇的匹配

ZYB’s Game

惊异于“最优策略”的选取,最终结果竟与奇偶性挂钩。

ZYB’s Premutation

常规题型,旧题重演,竟然跑偏了。
半年多前的某基础题的逆向问题。
同样用线段树或树状数组解决,关键是实现查找第k大的数、删除第k大的数并维护。也有基于查询数的更抽象高效的解法。
树状数组:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
* Dec 5, 2015 8:39:53 PM
* PrjName: 1205-03-2
* @semprathlon
*/
import java.io.*;
import java.util.*;
public class Main {
static int[] a,f;
static BIT tr;
static HashSet<Integer> st=new HashSet<Integer>();
static void print(int[] a,PrintWriter out){
int n=a.length-1;
for(int i=1;i<=n;i++)
out.print(a[i]+(i<n?" ":""));
out.println();
}
public static void main(String[] args) throws IOException{
InputReader in=new InputReader(System.in);
PrintWriter out=new PrintWriter(System.out);
int T=in.nextInt();
// tr=new BIT(5);
// out.print(tr.lowbit(2));
while(T-->0){
int n=in.nextInt();
a=new int[n+1];
f=new int[n+1];
tr=new BIT(n);
for(int i=1;i<=n;i++){
f[i]=in.nextInt();
tr.add(i, 1);
}

for(int i=n;i>=1;i--){
f[i]-=f[i-1];
int tmp=tr.find(i-f[i]-1);
// out.println(i+","+f[i]+","+tmp);
a[i]=tmp;
tr.add(tmp, -1);
}
print(a, out);
}
out.flush();
out.close();
}
}
class BIT{
int[] data;
int sz;
BIT(){}
BIT(int _sz){
sz=_sz;
data=new int[sz+1];
}
int lowbit(int x){
return x&(-x);
}
void add(int p,int v){
while(p<=sz){
data[p]+=v;
p+=lowbit(p);
}
}
int sum(int p){
int res=0;
while(p>0){
res+=data[p];
p-=lowbit(p);
}
return res;
}
int find(int p){
int l=1,r=sz;
while(l<r){
int mid=(l+r)>>1;
if (sum(mid)<=p)
l=mid+1;
else
r=mid;
}

return l;
}
}

线段树:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* Dec 6, 2015 4:42:31 PM
* PrjName: 1205-03-3
* @semprathlon
*/
import java.io.*;
import java.util.*;
public class Main {
static int[] a,f;
static ST tr;
static HashSet<Integer> st=new HashSet<Integer>();
static void print(int[] a,PrintWriter out){
int n=a.length-1;
for(int i=1;i<=n;i++)
out.print(a[i]+(i<n?" ":""));
out.println();
}
public static void main(String[] args) throws IOException{
InputReader in=new InputReader(System.in);
PrintWriter out=new PrintWriter(System.out);
int T=in.nextInt();
while(T-->0){
int n=in.nextInt();
a=new int[n+1];
f=new int[n+1];
tr=new ST(n);
tr.build(1, 1, n);
for(int i=1;i<=n;i++)
f[i]=in.nextInt();

for(int i=n;i>=1;i--){
f[i]-=f[i-1];
int tmp=tr.query(1, 1, n, f[i]+1);
// out.println(i+","+f[i]+","+tmp);
a[i]=tmp;

}
print(a, out);
}
out.flush();
out.close();
}
}
class ST{
int[] l,r,m,v;
int sz;
ST(){}
ST(int _sz){
sz=_sz<<2;
l=new int[sz];
r=new int[sz];
m=new int[sz];
v=new int[sz];
}
void build(int k,int x,int y){
l[k]=x;r[k]=y;m[k]=(x+y)>>1;
if (x<y){
build(k<<1,x,m[k]);
build(k<<1|1,m[k]+1,y);
}
v[k]=y-x+1;
}
int query(int k,int x,int y,int q){
if (l[k]==r[k]){
v[k]=0;
return l[k];
}
int res=0;
if (v[k<<1|1]>=q)
res=query(k<<1|1, m[k]+1, y, q);
else
res=query(k<<1,x,m[k],q-v[k<<1|1]);
v[k]=v[k<<1]+v[k<<1|1];
return res;
}

}

EC-final赛前一周

为信仰充值,与神犇赛码!年度最终决战,剑不出鞘更待何时?下周末双日,12.12~13,2015 ACM/ICPC EC-final 上海大学站,蓄势待发!全力备战

wpid-screenshot_2015-12-05-21-55-28.png wpid-230c7f4a3a36cc1f.jpg wpid-351324c2c7cdabb1.jpg wpid-screenshot_2015-12-05-21-55-05.png

wpid-screenshot_2015-12-05-22-02-33.png wpid-img_20151205_220342.jpg

BestCoder

Solved Problems To be solved
Numbers Array
Sum

Numbers

没话可说。

Sum

基础一维DP的变异

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* Nov 28, 2015 8:04:23 PM
* PrjName: Bc64-02
* @semprathlon
*/
import java.io.*;
import java.util.*;
public class Main {
static int[] a,s,f;
static int fn(int x){
return (1890*x+143)%10007;
}
public static void main(String[] args) throws IOException{
InputReader in=new InputReader(System.in);
PrintWriter out=new PrintWriter(System.out);
while(in.nextLine()!=null){
int n=in.nextInt();
a=new int[n+1];
s=new int[n+1];
f=new int[n+1];
for(int i=1;i<=n;i++){
a[i]=in.nextInt();
s[i]=s[i-1]+a[i];
}
int ans=s[n];
for(int i=1;i<=n;i++){
f[i]=Math.max(f[i-1]+fn(a[i]), s[i]);
ans=Math.max(ans, f[i]+s[n]-s[i]);
}
out.println(ans);
}
out.flush();
out.close();
}

}