**Limited-time discount**for early adopters: Pro Membership is only

**/month**when paid yearly.% OFF

**Want a free month?**Refer a friend.

Active In

Competitive Programming

International Olympiad in Informatics

Bitcoin and Blockchain

USA Computing Olympiad

New Zealand Olympiad in Informatics

Front-End Web Development

Indian Computing Olympiad (ICO)

Featured Contributions

comment in this discussion

This is for Pro Members

We like how far you've come. Upgrade today and get access to all of CommonLounge.

Already a member? Sign in.

Read more… (132 words)

comment in this discussion

#include<bits stdc++.h="">using namespace std;int main(){int n;cin >> n;int a[n];int dp[n];for(int i = 0;i < n;i++)cin >> a[i];dp[0] = a[0];dp[1] = a[1];for(int i = 2;i < n;i++){dp[i] = a[i]+min(dp[i-1],dp[i-2]);}int dp2[n];dp2[0] = a[n-1];dp2[1] = a[n-2];for(int i = n-3,o = 2;i>=0;i--,o++)dp2[o] = a[i]+min(dp2[o-1],dp2[o-2]);cout << min(dp[n-1],dp2[n-]);}

Read more…

comment in this discussion

i would love to join aroxbit i too am app devloper and have some games like tizzy bird ,bob upward ,cube maze(see on playstore) and cheers for IIIT

Read more… (28 words)

comment in this discussion

comment in this discussion

comment in this discussion

Just had to modify binary search a bit like in wormholes and accepted in 0.03 s

any feedback is most welcomed

#include <bits/stdc++.h>using namespace std;int binarysearch(long long a[],long long low,long long high,long long x){while(low <= high){long long mid = (high+low)/2;if(a[mid] >= x && a[mid-1] < x)return mid;if(a[mid] >= x && a[mid-1] >= x)high = mid-1;if(a[mid] < x)low = mid+1;}return -1;}int main(){

Read more… (21 words)

comment in this discussion

Same here i got 10 CGPA in 10th and now 18/40 and 20 in chemistry and physics and also i am not able to concentrate on jee

Read more… (27 words)

comment in this discussion

#include<bits/stdc++.h>using namespace std;int main(){int n;int kount = 0,kount2 = 0,maxx = 0,maxx2 = 0,index,index2;cin >> n;int a[n];for(int i = 0;i < n;i++){cin >> a[i];if(a[i] == 1){kount++;if(kount > maxx){maxx = kount;index = i+1;}}elsekount--;}cout << maxx << ' ' << index << ' ';kount = 0;for(int i = 0;i < n;i++){

Read more…

comment in this discussion

comment in this discussion