Skip to content

Commit aa5f531

Browse files
committed
delect executable files
1 parent a7ae7e3 commit aa5f531

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+79
-40
lines changed

1.1

-35.2 KB
Binary file not shown.

1.2

-18.1 KB
Binary file not shown.

1.3

-36.4 KB
Binary file not shown.

1.4

-48 KB
Binary file not shown.

1.5

-18 KB
Binary file not shown.

1.6

-17.5 KB
Binary file not shown.

1.7

-20.5 KB
Binary file not shown.

1.8

-34.7 KB
Binary file not shown.

10.4

-18.3 KB
Binary file not shown.

10.6

-71.4 KB
Binary file not shown.

10.6.1

-70 KB
Binary file not shown.

10.7

-70.9 KB
Binary file not shown.

12.3

-19.3 KB
Binary file not shown.

12.3.1

-19.4 KB
Binary file not shown.

12.4

-18.6 KB
Binary file not shown.

12.4.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using namespace std;
44
class Bitmap{
55
public:
66
Bitmap(int size = 32){
7-
bits = new int[size/32];
7+
bits = new int[size/32 + 1];
88
}
99
~Bitmap(){
1010
delete[] bits;

13.1

-36.8 KB
Binary file not shown.

13.6.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
class FirstClass {
5+
public:
6+
virtual void MethodA(int) {
7+
cout<<"FirstClass::MethodA(int)"<<endl;
8+
}
9+
virtual void MethodA(int, int) {
10+
cout<<"FirstClass::MethodA(int,int)"<<endl;
11+
}
12+
};
13+
14+
class SecondClass: public FirstClass {
15+
public:
16+
void MethodA1(int, int, int) {
17+
cout<<"SecondClass::MethodA(int)"<<endl;
18+
}
19+
};
20+
21+
int main() {
22+
SecondClass sc;
23+
sc.MethodA(0, 0);
24+
return 0;
25+
}

16.10

-18.3 KB
Binary file not shown.

19.11

-33.1 KB
Binary file not shown.

19.2

-17.9 KB
Binary file not shown.

19.3

-17.1 KB
Binary file not shown.

19.4

-17.1 KB
Binary file not shown.

19.5

-18.5 KB
Binary file not shown.

19.7

-17.2 KB
Binary file not shown.

2.1

-18.4 KB
Binary file not shown.

2.2

-17.8 KB
Binary file not shown.

2.3

-17.7 KB
Binary file not shown.

2.4

-18 KB
Binary file not shown.

2.5

-67.6 KB
Binary file not shown.

2.5.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ node* init(int a[], int n, int m){
2727
node* loopstart(node *head){
2828
if(head==NULL) return NULL;
2929
node *fast = head, *slow = head;
30-
while(fast->next!=NULL){
30+
while(fast && fast->next){
3131
fast = fast->next->next;
3232
slow = slow->next;
3333
if(fast==slow) break;
3434
}
35-
if(fast->next==NULL) return NULL;
35+
if(!fast || !fast->next) return NULL;
3636
slow = head;
3737
while(fast!=slow){
3838
fast = fast->next;

20.1

-17.3 KB
Binary file not shown.

20.11

-20.5 KB
Binary file not shown.

20.12

-20.1 KB
Binary file not shown.

20.2

-18.9 KB
Binary file not shown.

20.3

-18.9 KB
Binary file not shown.

20.4

-17.8 KB
Binary file not shown.

20.5

-35.1 KB
Binary file not shown.

20.7

-56.3 KB
Binary file not shown.

20.8

-35.2 KB
Binary file not shown.

20.9

-102 KB
Binary file not shown.

20.9.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ class Median{
1717
void Median::Insert(int v){
1818
if(max_heap.empty() && min_heap.empty())
1919
max_heap.push(v);
20+
// max_heap不为空,则往max_heap插入数据,
21+
// 往min_heap插入数据的话可能导致较小的数放到右边的堆
2022
else if(!max_heap.empty() && min_heap.empty())
21-
max_heap.push(v);
23+
max_heap.push(v);
2224
else if(max_heap.empty() && !min_heap.empty())
2325
min_heap.push(v);
2426
else{
@@ -57,16 +59,19 @@ int Median::GetValue(){//中位数为int,由于有除法,也可改为float
5759
int main(){
5860
srand((unsigned)time(0));
5961
Median md;
60-
vector<int> vi;
61-
int num = rand() % 30; //数量是30以内的随机数
62-
for(int i=0; i<num; ++i){
63-
int data = rand() % 100; //元素是100内的数
64-
vi.push_back(data);
65-
md.Insert(data);
66-
}
67-
sort(vi.begin(), vi.end());
68-
for(int i=0; i<num; ++i)
69-
cout<<vi.at(i)<<" "; //排序的序列
62+
// vector<int> vi;
63+
// int num = rand() % 30; //数量是30以内的随机数
64+
// for(int i=0; i<num; ++i){
65+
// int data = rand() % 100; //元素是100内的数
66+
// vi.push_back(data);
67+
// md.Insert(data);
68+
// }
69+
// sort(vi.begin(), vi.end());
70+
// for(int i=0; i<num; ++i)
71+
// cout<<vi.at(i)<<" "; //排序的序列
72+
md.Insert(3);
73+
md.Insert(1);
74+
md.Insert(2);
7075
cout<<endl<<md.GetValue()<<endl; //中位数
7176
return 0;
7277
}

3.1

-19.2 KB
Binary file not shown.

3.2

-24.5 KB
Binary file not shown.

3.3

-25.2 KB
Binary file not shown.

3.4

-70.9 KB
Binary file not shown.

3.5

-84.9 KB
Binary file not shown.

3.6

-147 KB
Binary file not shown.

4.1

-19.7 KB
Binary file not shown.

4.2

-74.6 KB
Binary file not shown.

4.3

-18.6 KB
Binary file not shown.

4.4

-109 KB
Binary file not shown.

4.5

-18.5 KB
Binary file not shown.

4.6

-69.3 KB
Binary file not shown.

4.7

-18.7 KB
Binary file not shown.

4.8

-61.6 KB
Binary file not shown.

5.1

-52.9 KB
Binary file not shown.

5.1.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ using namespace std;
44

55
void print_binary(int n){
66
vector<int> v;
7-
while(n != 0){
8-
if(n&1) v.push_back(1);
7+
int len = 8 * sizeof(int);
8+
int mask = 1;
9+
while(len--){
10+
if(n&mask) v.push_back(1);
911
else v.push_back(0);
10-
n >>= 1;
12+
mask <<= 1;
1113
}
1214
while(!v.empty()){
1315
cout<<v.back();

5.2

-37.8 KB
Binary file not shown.

5.3

-18.3 KB
Binary file not shown.

5.3.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ int next(int x){
2121
int max_int = ~(1<<31);
2222
int num = count_one(x);
2323
if(num == 0 || x == -1) return -1;
24-
for(++x; count_one(x) != num && x <= max_int; ++x);
24+
for(++x; count_one(x) != num && x < max_int; ++x);
2525
if(count_one(x) == num) return x;
2626
return -1;
2727
}
2828
int previous(int x){
2929
int min_int = (1<<31);
3030
int num = count_one(x);
3131
if(num == 0 || x == -1) return -1;
32-
for(--x; count_one(x) != num && x >= min_int; --x);
32+
for(--x; count_one(x) != num && x > min_int; --x);
3333
if(count_one(x) == num) return x;
3434
return -1;
3535
}
@@ -57,11 +57,12 @@ int previous1(int x){
5757
int num1 = count_one(xx) - count_one(x);
5858
x >>= bit;
5959
for(; num1 > 0; x = (x<<1) | 1, --num1, --bit);
60-
for(; bit > 0; x <<= 1, --bit);
60+
//for(; bit > 0; x <<= 1, --bit);
61+
x <<= bit;
6162
return x;
6263
}
6364
int main(){
64-
int a = -976756;//(1<<31)+(1<<29);//-8737776;
65+
int a = -9756;//(1<<31)+(1<<29);//-8737776;
6566
cout<<next(a)<<" "<<previous(a)<<endl;
6667
cout<<next1(a)<<" "<<previous1(a)<<endl;;
6768
return 0;

5.5

-17 KB
Binary file not shown.

5.6

-35.3 KB
Binary file not shown.

5.7

-18.6 KB
Binary file not shown.

5.7.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ int missing(int a[], int n){
1919
for(int i=0; i<n+1; ++i){
2020
if(!b[i]) return i;
2121
}
22+
delete[] b;
2223
}
2324
int fetch1(int a[], int j){
2425
return (a[j/32] >> (j % 32)) & 1;

7.1

-55.4 KB
Binary file not shown.

8.1

-22.1 KB
Binary file not shown.

8.2

-77.6 KB
Binary file not shown.

8.3

-102 KB
Binary file not shown.

8.4

-67.5 KB
Binary file not shown.

8.5

-17.3 KB
Binary file not shown.

8.6

-20 KB
Binary file not shown.

8.7

-17.5 KB
Binary file not shown.

8.8

-17.3 KB
Binary file not shown.

9.1

-17 KB
Binary file not shown.

9.2

-67.2 KB
Binary file not shown.

9.3

-17 KB
Binary file not shown.

9.3.cpp

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,19 @@ using namespace std;
33

44
int search(int a[], int low, int high, int x){
55
while(low <= high){
6-
//cout<<low<<" "<<high<<endl;
7-
//++cnt;
8-
int mid = (low+high)>>1;
6+
int mid = low + (high - low)/2;
97
if(a[mid] == x) return mid;
10-
if(a[mid] < x){
11-
if(a[mid] < a[low]){
12-
if(a[low] <= x) high = mid - 1;
13-
else low = mid + 1;
14-
}
15-
else{
8+
if(a[mid] >= a[low]) {
9+
if(x<a[mid] && x>=a[low])
10+
high = mid - 1;
11+
else
1612
low = mid + 1;
17-
}
1813
}
19-
else{
20-
if(a[mid] < a[low]){
14+
else {
15+
if(x>a[mid] && x<a[low])
16+
low = mid + 1;
17+
else
2118
high = mid - 1;
22-
}
23-
else{
24-
if(a[low] <= x) high = mid - 1;
25-
else low = mid + 1;
26-
}
2719
}
2820
}
2921
return -1;
@@ -36,5 +28,6 @@ int main(){
3628
2,2,2,2,2,2,2,2,3,2,2,2,2,2,2,2,2,2,2
3729
};
3830
cout<<search(a, 0, 11, 3)<<endl;
31+
cout<<search(b, 0, 18, 3)<<endl;
3932
return 0;
4033
}

9.5

-35.9 KB
Binary file not shown.

9.6

-19.7 KB
Binary file not shown.

9.7

-37.8 KB
Binary file not shown.

9.7.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ int lis(person p[], int n){
1818
int k = 1;
1919
d[0] = p[0].w;
2020
for(int i=1; i<n; ++i){
21-
if(p[i].w >= d[k-1]) d[k++] = p[i].w;
21+
if(p[i].w > d[k-1]) d[k++] = p[i].w;
2222
else{
2323
int j;
2424
for(j=k-1; j>=0 && d[j]>p[i].w; --j);//用二分可将复杂度降到O(nlogn)
@@ -27,6 +27,18 @@ int lis(person p[], int n){
2727
}
2828
return k;
2929
}
30+
int lis1(person p[], int n) {
31+
int k = 1;
32+
person d[n];
33+
d[0] = p[0];
34+
for(int i=1; i<n; ++i) {
35+
if(p[i].w>d[k-1].w && p[i].h>d[k-1].h) d[k++] = p[i];
36+
else {
37+
int j;
38+
for(j=k-1; j>=0 && (p[i].w<))
39+
}
40+
}
41+
}
3042
int main(){
3143
freopen("9.7.in", "r", stdin);
3244
int n;

9.7.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
70 150
44
56 90
55
75 190
6-
60 95
6+
56 95
77
68 110

0 commit comments

Comments
 (0)