Search found 6 matches

by Nikolay Archak
Wed Jan 28, 2004 11:03 am
Forum: Volume 106 (10600-10699)
Topic: 10615 - Rooks
Replies: 12
Views: 4568

min edge coloring in bipartite graph

IMHO, this problem is about graph coloring. We have a bipartite graph with first set of vertices representing rows & second set of vertices representing columns. Row vertex is connected with appropriate column vertex if and only if there is a rook in the appropriate cell. So, we have to find a minim...
by Nikolay Archak
Thu Dec 11, 2003 8:37 am
Forum: Volume 1 (100-199)
Topic: 153 - Permalex
Replies: 32
Views: 13065

Hi! Your brute force algorithms obviously cant pass the online judge because in the worst case it has to make as much as 2^30 procedure calls . :lol: Note, that permutation number is just number of permutations which are lesser than given one (+1). So you just have to count all permutations which ar...
by Nikolay Archak
Thu Dec 04, 2003 1:30 am
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 9996

145 WA

Hi! I tried to submit this program more than 30 times but always got WA. Can anybody said me what is wrong? Thanks in advance :-D #include<vector> #include<string> #include<set> #include<map> #include<list> #include<algorithm> #include<iostream> #include<math.h> #include<stdio.h> #include<queue> #in...
by Nikolay Archak
Thu Dec 04, 2003 1:07 am
Forum: Volume 1 (100-199)
Topic: 138 - Street Numbers
Replies: 93
Views: 7274

Hi!

I can give you a hint if you want.
You should find first 10 pairs of numbers n, m with a property
that 1 + 2 + ... + (n-1) = (n+1) + (n+2) + ... + ,m

For example, 1 + ... + 5 = 7 + 8 = 15.

Here, n corresponds to the programmer house number and m to the maximum house number on this street.
by Nikolay Archak
Wed Dec 03, 2003 3:59 am
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 27254

Hi! After small changes this program was submitted successfully. The main bug was that you used lexicografical comparison in next function instead of alphabetic one (function lessthan). Also, youd better care about possible spaces in the input, nobody said that word starts from the line beginning. I...
by Nikolay Archak
Tue Dec 02, 2003 6:47 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 50646

Hi!
Im not sure but may be you should change

next_permutation(order, order+3)

to

next_permutation((VI::iterator)order, (VI::iterator)(order+3))

BTW, you can submit your solutions by email, in this case you will receive the reply with exact description of compilation error.

Go to advanced search