Search found 74 matches

by Jehad Uddin
Fri Dec 31, 2010 11:44 am
Forum: Volume 9 (900-999)
Topic: 922 - Rectangle by the Ocean
Replies: 3
Views: 3839

Re: 922 - Rectangle by the Ocean

O(n^2 log n) is enough for the problem.Take two point and find the other two . Then check two point from the map in log n.
by Jehad Uddin
Mon Nov 15, 2010 5:40 pm
Forum: Volume 110 (11000-11099)
Topic: 11081 - Strings
Replies: 35
Views: 24367

Re: 11081 - Strings

@kbr_iut
iterative dp is faster with same approach.
run time reduced to 0.256 from 1.088 sec.
by Jehad Uddin
Sun Nov 14, 2010 6:17 am
Forum: Volume 109 (10900-10999)
Topic: 10931 - Parity
Replies: 18
Views: 12675

Re: 10931 - Parity

hello ghana, ;)
change ur pointer calculation

Code: Select all

char bin[50];
void calculate(int n)
{
use code tags while posting code
by Jehad Uddin
Sun Nov 14, 2010 5:46 am
Forum: Volume 118 (11800-11899)
Topic: 11838 - Come and Go
Replies: 22
Views: 11022

Re: 11838 - Come And Go

your implementation of tarjans algorithm is not correct. see http://en.wikipedia.org/wiki/Tarjan's_strongly_connected_components_algorithm there are some pop operations you are missing int pp; void tarjan( int x ){ ind[ x ] = c; low[ x ] = c; c ++; node.push( x ); for( int i = 1; i <= N; i ++ ){ if(...
by Jehad Uddin
Sun Nov 14, 2010 5:31 am
Forum: Volume 118 (11800-11899)
Topic: 11858 - Frosh Week
Replies: 20
Views: 6791

Re: 11858 - Frosh Week

use long long to avoid wa
by Jehad Uddin
Thu Nov 11, 2010 4:04 am
Forum: Volume 110 (11000-11099)
Topic: 11086 - Composite Prime
Replies: 33
Views: 22332

Re: 11086 - Composite Prime

219760
by Jehad Uddin
Thu Nov 04, 2010 7:58 am
Forum: Volume 118 (11800-11899)
Topic: 11857 - Driving Range
Replies: 21
Views: 11252

Re: 11857 - Driving Range

thanks :)
by Jehad Uddin
Thu Nov 04, 2010 4:39 am
Forum: Volume 118 (11800-11899)
Topic: 11857 - Driving Range
Replies: 21
Views: 11252

Re: 11857 - Driving Range

getting wa pls help :roll: :oops:

Code: Select all

got ac code removed :)

by Jehad Uddin
Fri Sep 24, 2010 8:47 am
Forum: Volume 118 (11800-11899)
Topic: 11843 - Guessing Game
Replies: 10
Views: 4788

Re: 11843 - Guessing Game

you can precalculate on ans

Code: Select all

for(i=1;i<21;i++)
 {
        ar[i][1]=1;
        ar[1][i]=i;
 }

    for(i=2;i<21;i++)
    {
        for(j=2;j<=55;j++)
        {
             ar[i][j]=1+ar[i-1][j-1]+ar[i][j-1];
       }
    }
then just chek ar[s][k]>=N then output k
by Jehad Uddin
Fri Sep 17, 2010 7:03 am
Forum: Volume 109 (10900-10999)
Topic: 10913 - Walking on a Grid
Replies: 23
Views: 14498

Re: 10913 - Walking on a Grid

my code passes all the cases of forum , but still i am getting wa ,pls help :oops: :oops: #include<stdio.h> #include<iostream> using namespace std; long long dp[80][80][10]; long long grid[80][80]; long long b[80][10]; long long c[80][10]; int n,k; int main() { int tst=0,i,j,l; long long INF=9000000...
by Jehad Uddin
Tue Sep 14, 2010 11:09 pm
Forum: Volume 116 (11600-11699)
Topic: 11645 - Bits
Replies: 9
Views: 5394

Re: 11645 - Bits

dp dimension is [length][stateOfNo][lastBit][AnyAdjacentOne] ,it will return how many nos having 11 pattern,
stateOfNo is whether it is <=N
AnyAdjacentOne is whether 11 occurs or not
Using this you can calculate number of 11s using another 4d BigIntArray
by Jehad Uddin
Tue Sep 14, 2010 7:03 am
Forum: Volume 105 (10500-10599)
Topic: 10541 - Stripe
Replies: 10
Views: 6424

Re: 10541 - Stripe

@ Piotr42
you can solve it using dp
dimension is [n][k];
by Jehad Uddin
Mon Sep 13, 2010 1:19 pm
Forum: Volume 113 (11300-11399)
Topic: 11391 - Blobs in the Board
Replies: 10
Views: 6178

Re: 11391 - Blobs in the Board

i am getting tle please help :oops:

Code: Select all


code removed got acc after 16 submission  

by Jehad Uddin
Fri Sep 10, 2010 2:47 pm
Forum: Volume 116 (11600-11699)
Topic: 11658 - Best Coalitions
Replies: 7
Views: 4571

Re: 11658 - Best Coalitions

thank you :D

Code: Select all

code removed got acc.
by Jehad Uddin
Fri Sep 10, 2010 1:33 pm
Forum: Volume 109 (10900-10999)
Topic: 10910 - Marks Distribution
Replies: 26
Views: 17023

Re: 10910 - Marks Distribution

i got wa in this code,but when i switched to java ,in same process i got ac
this is the wa code

Code: Select all

code removed...

Go to advanced search