Monday 23 March 2015
DP (rectangles perimetere (spoj) ,,,Sherlock and cost (hackerrank) ) -->> 2^n DP
1) DP prblm of 2^n type ,(rectangles perimetre http://www.spoj.com/problems/MMAXPER/)
#include
using namespace std;
int main()
{
int n;
cin>> n;
int a[n],b[n],dp[n][2],i,j,k;
for(i=0;i>a[i]>>b[i];
dp[0][0]=a[0], dp[0][1]=b[0];
for(i=1;i
using namespace std;
int dp[100002][2];
int a[100002];
int main()
{
int t;
cin>>t;
while(t--)
{
int n,i,j,k;
cin>>n;
dp[0][0]=0;
dp[0][1]=0;
for(i=0;i>a[i];
for(i=1;i
Subscribe to:
Post Comments (Atom)
Uploading and Running Lambda function in AWS
Main.go package main import ( "fmt" "encoding/json" "log" "github.com/aws/aws-lambda-g...
-
http://codeforces.com/contest/476/problem/B #include < bits / stdc ++. h > using namespace std ; string s1 , s2 ; int val ...
-
http://codeforces.com/contest/476/problem/A #include < bits / stdc ++. h > using namespace std ; int dp [ 10001 ][ 5055 ];...
-
http://www.spoj.com/problems/DQUERY/en/ DQUERY -...
No comments:
Post a Comment