| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3408 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 153 |
| 2 | nik_exists | 151 |
| 3 | maroonrk | 150 |
| 4 | maspy | 149 |
| 5 | AmShZ | 146 |
| 6 | Um_nik | 143 |
| 7 | Errichto | 139 |
| 8 | adamant | 135 |
| 9 | BledDest | 134 |
| 10 | cry | 130 |
|
0
wow nice! but i have a dumb doubt in finding maximum independent set of each connected component.for each component can we just color a node with red and the adjacency list with blue and its adjacency list with red....now we can count how many are colored in red and blue and the max of no of blue and red isn't maximum independent set?I found there exist algo to do it so i am sure i am wrong.could u tell where i was wrong(i could'nt find counter example) |
|
-14
my friend ,i am practicing ,i did not ask how to practice,read correctly before saying something(no offense).due to you many people downvoted this and i did not my answer to my genuine question |
|
0
Auto comment: topic has been updated by electro177 (previous revision, new revision, compare). |
|
0
No one got? |
|
0
Auto comment: topic has been updated by electro177 (previous revision, new revision, compare). |
|
-6
Dude ,this is from a company test,I could not get this while solving,so asking |
|
0
How to solve Third problem?I thought of it for long time but did not get ideas.In a classical knapsack problem we find maximum sum of values, but here for a given sum there can be various possiblities (but which to choose),i am clueless ,some one please please please give idea and code if possible:) |
|
0
anyone knows 2nd one :') |
|
0
Some one please help,this is not any ongoing stuff |
|
-63
for this problem ~~~~~ define all(x) (x).begin(), (x).end()vector<vector> ans; int n; class Solution { public:
void solve(int index ,int target ,vector<int>& candidates,vector<int> &ds){
if(index==n){
if(target==0){
vector<int> temp=ds;
sort(all(temp));
ans.push_back(temp);
}
return;
}
if(target>=candidates[index]){
ds.push_back(candidates[index]);
solve(index+1,target-candidates[index],candidates,ds);
ds.pop_back();
}
solve(index+1,target,candidates,ds);
}
public:
vector<vector<int>> combinationSum2(vector<int>& candidates, int target) {
sort(all(candidates));
ans.clear();
n=target;
vector<int> ds;
solve(0,target,candidates,ds);
sort(all(ans));ans.resize(unique(all(ans)) — ans.begin()); return ans; } }; ~~~~~ for this problem i did that and it worked on a test case but gave runtime error for other test ~~~~~==29==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000007d4 at pc 0x000000348638 bp 0x7fffa9e75030 sp 0x7fffa9e75028 READ of size 4 at 0x6020000007d4 thread T0 #4 0x7fb195bd70b2 (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) 0x6020000007d4 is located 0 bytes to the right of 4-byte region [0x6020000007d0,0x6020000007d4) allocated by thread T0 here: #6 0x7fb195bd70b2 (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) Shadow bytes around the buggy address: 0x0c047fff80a0: fa fa fd fa fa fa fd fa fa fa fd fd fa fa fd fa 0x0c047fff80b0: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa 0x0c047fff80c0: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa 0x0c047fff80d0: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa 0x0c047fff80e0: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa =>0x0c047fff80f0: fa fa fd fa fa fa fd fa fa fa[04]fa fa fa 04 fa 0x0c047fff8100: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8110: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8120: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8130: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8140: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==29==ABORTING ~~~~~ |
|
0
Auto comment: topic has been updated by electro177 (previous revision, new revision, compare). |
|
-10
Auto comment: topic has been updated by electro177 (previous revision, new revision, compare). |
|
0
what is the transition in this question ,why are we going from s+w to s for every block |
|
0
Auto comment: topic has been updated by electro177 (previous revision, new revision, compare). |
|
0
Dude instead of downvotes ,anyone please help |
|
0
Auto comment: topic has been updated by electro177 (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by electro177 (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by electro177 (previous revision, new revision, compare). |
|
0
I defined ll as long long first and then did the rep for for loop but it is still giving runtime error |
|
0
Fifa mobile |
|
0
Auto comment: topic has been updated by electro177 (previous revision, new revision, compare). |
|
0
wtf this is real and ya help |
|
+1
thank u for all suggestions.i will do my level best |
|
0
Please help |
|
0
Auto comment: topic has been updated by electro177 (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by electro177 (previous revision, new revision, compare). |
|
-12
Bro, coach me also |
| Name |
|---|


