Search found 19 matches

by Munchor
Sat Apr 06, 2013 8:57 pm
Forum: Volume 109 (10900-10999)
Topic: 10901 - Ferry Loading III
Replies: 54
Views: 22911

Re: 10901 - Ferry Loading III

2 10 10 0 left 10 left 20 left 30 left 40 left 50 left 60 left 70 left 80 left 90 left 2 10 3 10 right 25 left 40 left 3 5 7 0 left 1 left 2 left 3 left 5 left 5 right 11 right 2 24 7 2 right 7 left 12 right 22 right 34 right 73 right 76 right I get all those cases correct. However, I get these two...
by Munchor
Sat Apr 06, 2013 2:25 am
Forum: Volume 100 (10000-10099)
Topic: 10034 - Freckles
Replies: 101
Views: 31884

Re: 10034 - Freckles

I found my error, I had to connect ALL dots with all other dots, I was missing some dots.
by Munchor
Fri Apr 05, 2013 2:58 am
Forum: Volume 3 (300-399)
Topic: 314 - Robot
Replies: 30
Views: 6334

Re: 314, Robot, Help!

I'm just leaving the tip here - be careful with collision, it's tricky!
by Munchor
Fri Apr 05, 2013 2:46 am
Forum: Volume 100 (10000-10099)
Topic: 10034 - Freckles
Replies: 101
Views: 31884

Re: 10034 - Freckles

#include <stdio.h> #include <string.h> #include <vector> #include <queue> #include <utility> #include <cmath> using namespace std; #define MAX 101 double freckles[MAX][2]; int u, v, cases; double mst_cost; vector<int> pset(1000); priority_queue< pair< double, pair <double, double> > > edge_list; do...
by Munchor
Sat Mar 30, 2013 2:19 am
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 31011

Re: 482 Permutation Arrays

brianfry713 wrote:That's not what the problem is asking. Don't sort the doubles, keep them as strings
"32.0" should be the third element in the new array.
"54.7" should be the first element in the new array.
"-2" should be the second element in the new array.
Thank you, I completely misunderstood the problem!
by Munchor
Fri Mar 29, 2013 11:19 pm
Forum: Volume 3 (300-399)
Topic: 314 - Robot
Replies: 30
Views: 6334

Re: 314, Robot, Help!

#include <stdio.h> #include <string.h> #include <queue> using namespace std; #define MAX_SIDE 51 struct node { int x; int y; int time; int direction; }; int m, n, b[2], e[2], grid[MAX_SIDE][MAX_SIDE], min_time, visited[MAX_SIDE][MAX_SIDE][4]; queue<node> q; char direction[6]; char directions[4][6] ...
by Munchor
Fri Mar 29, 2013 2:27 am
Forum: Volume 3 (300-399)
Topic: 314 - Robot
Replies: 30
Views: 6334

Re: 314, Robot, Help!

My program (used BFS) doesn't even solve example IO, and I'd like some help with it, I've debugged as much as I possibly can: #include <stdio.h> #include <string.h> #include <queue> using namespace std; #define MAX_SIDE 51 struct node { int x; int y; int time; int direction; }; int m, n, b[2], e[2],...
by Munchor
Thu Mar 21, 2013 6:47 pm
Forum: Volume 6 (600-699)
Topic: 624 - CD
Replies: 77
Views: 33018

Re: 624 - CD

brianfry713 wrote:Program should find the set of tracks which fills the tape best and print it in the same sequence as the tracks are stored on the CD
Yeah, I've realized that, but I have no idea of how to oredr them like in the input. I'm asking for help with this part.
by Munchor
Wed Mar 20, 2013 10:54 pm
Forum: Volume 110 (11000-11099)
Topic: 11057 - Exact Sum
Replies: 50
Views: 20954

Re: 11057 - Exact Sum

#include <stdio.h> #include <string.h> #include <stdlib.h> using namespace std; #define MAX 10001 long long int books[MAX]; int main() { long long int n_books, i, u, solution[2], money; while (scanf("%lld", &n_books) != EOF) { memset(books, 0, sizeof books); memset(solution, 0, sizeof solution); fo...
by Munchor
Wed Mar 20, 2013 10:16 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 31011

Re: 482 Permutation Arrays

It looks like you misunderstood the problem. Don't sort an array of doubles, just keep them as strings. Permute the strings according to the index array. brianfry713, take a look at this example case: 1 3 1 2 32.0 54.7 -2 I sort the values and I get "-2", "32.0", "54.7". Then the "3 1 2" means - "f...
by Munchor
Wed Mar 20, 2013 2:14 am
Forum: Volume 113 (11300-11399)
Topic: 11340 - Newspaper
Replies: 154
Views: 42950

Re: 11340 - Newspaper

brianfry713 wrote:Munchor, try making final_value long long.
I tried and I still get WA.

But then I tried to move to unsigned char instead of char and it worked, thanks brianfry!
by Munchor
Wed Mar 20, 2013 1:16 am
Forum: Volume 105 (10500-10599)
Topic: 10503 - The dominoes solitaire
Replies: 16
Views: 11477

Re: 10503 - The Dominoes Solitaire

Thank you very much!
by Munchor
Wed Mar 20, 2013 12:48 am
Forum: Volume 6 (600-699)
Topic: 624 - CD
Replies: 77
Views: 33018

Re: 624 - CD

#include <stdio.h> #include <string.h> #include <vector> #define MAX 21 using namespace std; unsigned int n, n_tracks, i, u, k; int max_result; int tracks[MAX]; int used[MAX]; vector<int> answer; vector<int> current_list; int max(int a, int b) { return a > b ? a : b; } int get_maximum_tracks(int j,...
by Munchor
Tue Mar 19, 2013 1:51 am
Forum: Volume 105 (10500-10599)
Topic: 10503 - The dominoes solitaire
Replies: 16
Views: 11477

Re: 10503 - The Dominoes Solitaire

I'd just love some critical input for this one. I get correct output for the example, but WA on UVa: #include <stdio.h> #include <string.h> using namespace std; unsigned int n, m, i, u, filled; unsigned int first[2]; unsigned int last[2]; unsigned int dominoes[15][2]; unsigned int used[20]; bool pro...
by Munchor
Wed Mar 13, 2013 11:49 pm
Forum: Volume 113 (11300-11399)
Topic: 11340 - Newspaper
Replies: 154
Views: 42950

Re: 11340 - Newspaper

I fixed my unsigned chars to: #include <stdio.h> #include <string.h> using namespace std; int main() { unsigned int n, i, k, u, temp_value, m, final_value = 0; char temp_char; int values[1000]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d\n", &k); memset(values, 0, sizeof values); final_valu...

Go to advanced search