| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3611 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | Radewoosh | 3415 |
| 8 | Um_nik | 3376 |
| 9 | maroonrk | 3361 |
| 10 | XVIII | 3345 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 162 |
| 2 | adamant | 148 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 143 |
| 5 | errorgorn | 141 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 133 |
|
0
2201C — Rigged Bracket Sequence Can someone help in understanding the solution? Didn't get proper understanding of the solution. |
|
0
how did you decide that only fib0^2 + fib1^2 + .... fib^n = fibn*fib(n+1) is the only way to split the product into n+1 numbers? Do you have some proof regarding this? |
|
0
Sorry I haven't written recursive . But iterative one : include<bits/stdc++.h>using namespace std; int mod = 1e9 +7; int main(){ int n,x; cin>>n>>x; pair<int,int> h[n]; for(int i=0;i<n;i++){
cin>>h[i].first;
}
for(int i=0;i<n;i++){
cin>>h[i].second;
}
int dp[n+1][x+1];
dp[0][0]=0;
for(int i=0;i<=n;i++){
dp[i][0] = 0;
}
for(int i=0;i<=x;i++){dp[0][i]=0;}
for(int i=1;i<=n;i++){
for(int j=1;j<=x;j++){
dp[i][j] = dp[i-1][j];
if(j>=h[i-1].first){
dp[i][j] = max(dp[i-1][j- h[i-1].first]+h[i-1].second,dp[i][j]);
}
dp[i][j] %= mod;
}
}cout<<dp[n][x]<<"\n"; } |
|
0
I tried it but still i'm struck |
|
0
I don't have it. It was asked in online assessment. |
|
0
Auto comment: topic has been updated by abhilash_8642 (previous revision, new revision, compare). |
|
0
I don't even know there was a thing called coding when i'am in school |
|
+2
|
|
-27
. |
|
0
use faster i/o code : ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); |
|
0
Thnks for your help |
|
0
130 day streak ... How did you get that much patience? |
|
0
this worked for me... |
|
0
given an array of n elements, and q queries with two types 1 l r s e indicates flip bits of positions [s,s+1,....e] of subarray [al,..ar], 2 l r s e indicates print the number of set bits [s,s+1,...e] of subarray [al,...ar] n<=q<= 10^5, a[i] < 10^9 0<s<e<30 Can anyone help me in doing this? |
|
0
can you send the code of 4th quesiton? So that i can see what is the approach of the quesion... |
|
0
did you get 4th question ? I solved it in o(n*n) . Please share the approach! Thanks in advance |
| Name |
|---|


