Search found 11 matches

by matheusdallrosa
Thu Nov 12, 2015 1:26 am
Forum: Volume 105 (10500-10599)
Topic: 10594 - Data Flow
Replies: 40
Views: 25558

Re: 10594 - Data Flow

HI, the first case on the PDF, shouldn't be:
4 5
1 4 1
1 3 3
3 4 4
1 2 2
2 4 5
20 10

instead of:
4 5
1 4 1
1 3 3
3 4 4
1 2 2
2 4 5
20 1
?
by matheusdallrosa
Thu Jan 22, 2015 7:24 am
Forum: Volume 10 (1000-1099)
Topic: 1047 - Zones
Replies: 17
Views: 5572

Re: 1047 - Zones

The post was removed, i had an error in the way that i counted the intersections.
by matheusdallrosa
Tue Jan 20, 2015 1:53 am
Forum: Volume 106 (10600-10699)
Topic: 10660 - Citizen attention offices
Replies: 20
Views: 6778

Re: 10660 - Citizen attention offices

And we want to minimize the sum of the minimum distances from all the areas, but having into account the quantity of people living in each area. Because of this part of the statement i think that the sample output is the sum of the distances between an office to all the areas, but i can't find where...
by matheusdallrosa
Sat Jan 17, 2015 11:00 am
Forum: Volume 109 (10900-10999)
Topic: 10973 - Triangle Counting
Replies: 31
Views: 13034

Re: 10973 - Triangle Counting

Just a tip, especially for those who get TLE and RTE 1. A brute force O(n^3) approach can get Accepted (with use of scanf and good memory allocation) 2. Vertices in the input CAN be greater than n (check problem description) 3. You only need to count triangles up to vertex n About the first item: m...
by matheusdallrosa
Sat Jan 17, 2015 3:58 am
Forum: Volume 106 (10600-10699)
Topic: 10660 - Citizen attention offices
Replies: 20
Views: 6778

Re: 10660 - Citizen attention offices

anybody could explain this cases?

4
1
2 2 1
4
0 0 1
4 4 1
0 4 1
4 0 1
5
0 0 1
1 1 1
2 2 1
3 3 1
4 4 1
7
4 2 2
3 3 1
2 4 3
2 1 1
1 3 4
1 2 2
1 0 1

Its the cases of the problem, i want to know where the five areas stay in every test so i can understand this, the problem statement is not so clear.
by matheusdallrosa
Sun Jan 11, 2015 4:34 am
Forum: Volume 105 (10500-10599)
Topic: 10502 - Counting Rectangles
Replies: 24
Views: 11782

Re: 10502 - Counting Rectangles

i tested exhaustively but i still get WA. code: typedef long long int lld; int main(){ int n, m; char board[120][120]; while( scanf(" %d", &n ) != EOF ){ if(!n)break; scanf(" %d", &m ); int t = 0; memset(board,'0',sizeof(board)); for( int i = 1; i <= n; i++ ){ for( int j = 1; j <= m; j++ ){ scanf(" ...
by matheusdallrosa
Sat Jan 10, 2015 9:40 pm
Forum: Volume 6 (600-699)
Topic: 626 - Ecosystem
Replies: 8
Views: 4861

Re: 626 - Ecosystem

AFf the PDF format version has not the statement: Output a blank line after each test case.
But the HTML format has.
by matheusdallrosa
Thu Jan 08, 2015 5:11 am
Forum: Volume 3 (300-399)
Topic: 347 - Run
Replies: 20
Views: 5857

Re: 347 - Run

i don't know why i'm getting TLE, i tested with all numbers in 10...9999999 and no one of the tests became in infinite loop.

code:

Code: Select all

got AC
I don't know where is the performance problem. Please help-me?
by matheusdallrosa
Sun Sep 07, 2014 9:43 pm
Forum: Algorithms
Topic: DP Table Method
Replies: 2
Views: 2343

Re: DP Table Method

i had the same problem, but if you see when we close the recurrence formula, we know where to get the things on the table by the parameters of the function on the formula, example: http://www.geeksforgeeks.org/dynamic-programming-set-5-edit-distance/ on this formula we need to take the states that a...
by matheusdallrosa
Sun Sep 07, 2014 9:31 pm
Forum: Algorithms
Topic: Maximum Independent Set
Replies: 0
Views: 991

Maximum Independent Set

How to indentify this kind of problem? In this problem: 12083 - Guardian of Decency I solved it because i had the spoiler on the competitive programming 3, the book says that we need to do the exactly the opposite of what the problem asks and them print V - MCBM. I want to know if the independent se...
by matheusdallrosa
Sun Sep 07, 2014 9:23 pm
Forum: Algorithms
Topic: Help with Unbounded Knapsack
Replies: 1
Views: 3029

Re: Help with Unbounded Knapsack

if you save the best previous item of each item i think that in the and you will have the list, make some tests and reply.

Go to advanced search