Блог пользователя pistone

Автор pistone, 12 лет назад, По-английски

here is a challenging problem in its own : link is below http://codeforces.me/blog/entry/4611

i have tried different approaches for this one , but none produces answers for 10 testcases within 1 minute time .

hope somebody is able to crack it .

Полный текст и комментарии »

  • Проголосовать: нравится
  • -14
  • Проголосовать: не нравится

Автор pistone, 12 лет назад, По-английски

hello ,

i am a newbie in the world of algorithmic competition , and hope if anybody can mentor me in this arena.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

Автор pistone, 12 лет назад, По-английски

since the min cost flow algorithms operate on integers , if the cost matrix containes double numbers , how can we adapt it to min cost flow algorithms

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

Автор pistone, 12 лет назад, По-английски

can anybody share code snippet for min cost max flow algorithm , specially for the transportation problem types.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -20
  • Проголосовать: не нравится

Автор pistone, 12 лет назад, По-английски

there are 10000 stations numbered from 0 to 9999. from each station , some load has to be transferred to another station by train . the fuel consumption of train between 2 successive station is 1 litre .

Find the minimum amount of fuel , in which loads can be transferred to all the destination stations.

constraints: the load for each station is between 1 and 100 inclusive. a train cannot carry more than 50 kgs of load at one time. a train cannot carry loads of several stations at the same time even if it can take more load . several stations can send their load to a station at the same time.

the first train leaves station 0.

Input : the destination station and load to be transferred for each of the 10000 stations.

need help in solving this problem

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор pistone, 12 лет назад, По-английски

hi all, it would be helpful if somebody can give links to problems related to dfs and bfs.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится

Автор pistone, 13 лет назад, По-английски

given , there are 3 points in 2d space . also there are 10000 points in 2d space . each of the 3 points in the first set can be related to at max 3500 points from the 2nd set. how to assign all the 10000 points in the 2nd set , to the 3 points in 1st set , so that the sum of distances of points in 2nd set from points in 1st set is minimised ?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

Автор pistone, 13 лет назад, По-английски

There are 10000 stations numbered from 0 to 9999. from each station , some load has to be transferred to another station by train . the fuel consumption of train between 2 successive station is 1 litre .

Find the minimum amount of fuel , in which loads can be transferred to all the destination stations.

constraints: the load for each station is between 1 and 100 inclusive. a train cannot carry more than 50 kgs of load at one time. a train cannot carry loads of several stations at the same time even if it can take more load . several stations can send their load to a station at the same time.

the first train leaves station 0.

Input : the destination station and load to be transferred for each of the 10000 stations.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -10
  • Проголосовать: не нравится

Автор pistone, 13 лет назад, По-английски

there are 10000 stations numbered from 0 to 9999. from each station , some load has to be transferred to another station by train . the fuel consumption of train between 2 successive station is 1 litre .

Find the minimum amount of fuel , in which loads can be transferred to all the destination stations.

constraints: the load for each station is between 1 and 100 inclusive. a train cannot carry more than 50 kgs of load at one time. a train cannot carry loads of several stations at the same time even if it can take more load . several stations can send their load to a station at the same time.

the first train leaves station 0.

Input : the destination station and load to be transferred for each of the 10000 stations.

need help in solving this problem

Полный текст и комментарии »

  • Проголосовать: нравится
  • -5
  • Проголосовать: не нравится

Автор pistone, 13 лет назад, По-английски
is it possible to have codeforces t-shirts , i am ready to buy many

Полный текст и комментарии »

  • Проголосовать: нравится
  • -13
  • Проголосовать: не нравится

Автор pistone, 13 лет назад, По-английски

hi everyone,
Is there any indicative list of datastructure related problems in SGU problem set,
specially  "TREES" .

Полный текст и комментарии »

  • Проголосовать: нравится
  • -5
  • Проголосовать: не нравится

Автор pistone, 13 лет назад, По-английски

my approach is to create 3 rotations for each box  and sort the boxes according to increasing base area.

Then run LIS on the sorted data.

it gives correct results for test samples in the problem , still getting WA.

Need help !!!!

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор pistone, 13 лет назад, По-английски

here is my solution for thi problem from EL JUDGE ,
but the time limit is exceeds by 1 second , 


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
using namespace std;

typedef struct{
 int m;
 int s;
}rec;

bool compare(const rec& r1,const rec& r2)
{
 return(r1.m + r1.s <= r2.m + r2.s);

}

int main()
{
 int n,i,j;
 int best[100000] ;

 cin>>n;
 i = 0;
 vector<rec> v;
 rec r;
 while(i < n)
 {
  //cin>>r.m;
  //cin>>r.s;
  scanf("%d",&r.m);
  scanf("%d",&r.s);
  v.push_back(r);
  i++;
 }
 for(i = 0;i<=n;i++)
  best[i] = 4000000;
 best[0] = 0;

 sort(v.begin(),v.end(),compare);
 int maxcount = 0;
 for(i= 0; i < n;i++)
 {
  for(j = maxcount + 1; j > 0;j--)
  {

   if(v[i].s >= best[j -1] && (v[i].m + best[j -1] < best[j]))
   {
    best[j] = v[i].m + best[j -1];
    if(j > maxcount) maxcount = j;
   }

  }

 }
 cout<<maxcount<<endl;
 return 0;
}



need  help to optimise this ,  the input length can be upto 100000

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор pistone, 13 лет назад, По-английски

hi all ,
i have read few english versions of some russian  programming books .
And my love for them has increased .
But i have one book by  author "Menshikov" . Its is russian language (djvu format).
I want to convert it into english .
Help please !!!!!!!! :)

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор pistone, 13 лет назад, По-английски

for me it wa quite a problem , since i strictly used C++ to solve it.

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится