Search found 119 matches

by midra
Sun Oct 12, 2008 8:49 pm
Forum: Volume 110 (11000-11099)
Topic: 11055 - Homogeneous squares
Replies: 16
Views: 7821

Re: 11055 - Homogeneous squares

EDIT: I made a stupid mistake, sorry
by midra
Sun Jun 10, 2007 11:21 pm
Forum: C++
Topic: reading words from input...
Replies: 7
Views: 3136

thank you so much!!!!! :D :D :D
by midra
Sun Jun 10, 2007 8:36 pm
Forum: C++
Topic: reading words from input...
Replies: 7
Views: 3136

thank you!!! and I don't want to be annoying but I have just one more question how can I distinguish between a new line in an input like this: "w1 w2 w3 w4 w5 w6 w7 ww1 ww2 ww3 ww4 ww5 ww6 ww7" In case that this represents different tests. I mean, I need to know when a newLine alone appears so the n...
by midra
Sun Jun 10, 2007 6:37 pm
Forum: C++
Topic: reading words from input...
Replies: 7
Views: 3136

thanks for your reply... but how can I know when a line ends... I mean, if in the input I have this: "word1 word2 word3 word4 word5 word6 word7" I want to make something whit word1 word2 and word3, and then do it again with word4, word5, word6 and word7 If I make like you say with stringstream I thi...
by midra
Sun Jun 10, 2007 4:02 am
Forum: C++
Topic: reading words from input...
Replies: 7
Views: 3136

reading words from input...

Hi... I need help to do the following: I want to take from standard input a line like this " word1 word2 word3 wordn" and get all the words in differents strings (strings from <string> of course) does someone know an easy way to do it?? is it any other way (easier) to manage the words in an input li...
by midra
Tue Apr 24, 2007 6:40 pm
Forum: Algorithms
Topic: tju problem
Replies: 0
Views: 2027

tju problem

Hi, I would like to know if someone can help me with this problem: http://acm.tju.edu.cn/toj/showp2171.html This is what I tought until now: I can go from first character to last character and sum S %2006 To know the S of every character I know that S[0]=1 S = i/k | min k (S[i-k]=(i-k)/k && i%k==0 &...
by midra
Thu Feb 15, 2007 4:47 pm
Forum: Volume 10 (1000-1099)
Topic: 1051 - Bipartite Numbers
Replies: 0
Views: 1582

1051 - Bipartite Numbers

Hi! the problem I was trying to solve is 3564 - Bipartite Numbers http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=3564 I just think in generating bipartite numbers and then return the minimum that is valid...but maybe the solution can be bigger than long long numbers, in this case ...
by midra
Sat Oct 07, 2006 4:34 am
Forum: Algorithms
Topic: dfs /bfs problems
Replies: 1
Views: 3630

dfs /bfs problems

HI!
I want to practice dfs/bfs problems. I would appreciate if someone knows which problems can be solved with this.
thx
by midra
Wed Jun 07, 2006 7:15 am
Forum: Volume 110 (11000-11099)
Topic: 11047 - The Scrooge Co Problem
Replies: 31
Views: 14108

Hi ! I did this problem in 2 ways but none of these works I always get WA!! :cry: here are my codes: #include <stdio.h> #include <stdlib.h> #include <string.h> #define MIN(a,b) a<b?a:b char loc[101][22]; int d[101][101],dist[102],antecesor[102]; bool visited[101]; char init[22],end[22],name[32]; int...
by midra
Thu Jun 01, 2006 4:46 am
Forum: Volume 110 (11000-11099)
Topic: 11038 - How Many O's?
Replies: 24
Views: 10404

I use %I64d when I am on windows
and %lld for linux
so, remember always to put to the codes that you send to the online judge %lld instead of %I64d
by midra
Tue May 30, 2006 5:16 am
Forum: Volume 110 (11000-11099)
Topic: 11038 - How Many O's?
Replies: 24
Views: 10404

thanks...I think I understand my error
I really apreciate your help!
by midra
Mon May 29, 2006 4:44 am
Forum: Volume 110 (11000-11099)
Topic: 11038 - How Many O's?
Replies: 24
Views: 10404

hi, I have difficulty with this problem I think it in this way: from 0..9 I have one 0 from 0..99 I have ten 0's so I think it in this way: cant representes amount of 0's from 0..(10^i - 1) so I have cant[1]=1 cant[2]=10 for(i=3;i<11;i++) cant =9*(cant[i-1]+pow(10,i-2)) + cant[i-1]; I though this: s...
by midra
Sat May 20, 2006 1:19 am
Forum: Algorithms
Topic: help with divide & conquer problem
Replies: 3
Views: 1622

thanks for your help!
I made the problem of compute a^n with order log(n)...but I think it's easier.
by midra
Sun May 14, 2006 9:15 pm
Forum: Algorithms
Topic: help with divide & conquer problem
Replies: 3
Views: 1622

help with divide & conquer problem

Hi ! I am having troubles in doing an implementation of a very common problem. I have a matrix A and I want to get the matrix A^n. As far as I know the best way to do this is to make something like: A^(n/2)*A^(n/2) if n mod 2==0 A^(n-1)*A if n mod 2 !=0 I get the idea of the recursive algorithm, but...
by midra
Wed Dec 28, 2005 10:49 pm
Forum: Algorithms
Topic: complexity problem
Replies: 2
Views: 1105

complexity problem

I need help to prove a problem about complexity. Let a Function defined by: F(0) = 3 F(n+1) = 3 * F(n) + h(n), where h ∈ θ(n) Prove that F ∈ O(3^n) I get that the function is O(n*3^n), but I don't know if I did it wrong or how to do it Please ask me if the problem is not clear enough. thanks for rea...

Go to advanced search