Search found 19 matches
- Sat Apr 06, 2013 8:57 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10901 - Ferry Loading III
- Replies: 54
- Views: 32618
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 ...
- Sat Apr 06, 2013 2:25 am
- Forum: Volume 100 (10000-10099)
- Topic: 10034 - Freckles
- Replies: 101
- Views: 49109
Re: 10034 - Freckles
I found my error, I had to connect ALL dots with all other dots, I was missing some dots.
- Fri Apr 05, 2013 2:58 am
- Forum: Volume 3 (300-399)
- Topic: 314 - Robot
- Replies: 30
- Views: 11943
Re: 314, Robot, Help!
I'm just leaving the tip here - be careful with collision, it's tricky!
- Fri Apr 05, 2013 2:46 am
- Forum: Volume 100 (10000-10099)
- Topic: 10034 - Freckles
- Replies: 101
- Views: 49109
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 ...
- Sat Mar 30, 2013 2:19 am
- Forum: Volume 4 (400-499)
- Topic: 482 - Permutation Arrays
- Replies: 159
- Views: 53599
Re: 482 Permutation Arrays
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!
"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!
- Fri Mar 29, 2013 11:19 pm
- Forum: Volume 3 (300-399)
- Topic: 314 - Robot
- Replies: 30
- Views: 11943
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 ...
- Fri Mar 29, 2013 2:27 am
- Forum: Volume 3 (300-399)
- Topic: 314 - Robot
- Replies: 30
- Views: 11943
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 ...
#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 ...
- Thu Mar 21, 2013 6:47 pm
- Forum: Volume 6 (600-699)
- Topic: 624 - CD
- Replies: 77
- Views: 46250
Re: 624 - 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.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
- Wed Mar 20, 2013 10:54 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11057 - Exact Sum
- Replies: 50
- Views: 30555
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 ...
- Wed Mar 20, 2013 10:16 pm
- Forum: Volume 4 (400-499)
- Topic: 482 - Permutation Arrays
- Replies: 159
- Views: 53599
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 ...
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 ...
- Wed Mar 20, 2013 2:14 am
- Forum: Volume 113 (11300-11399)
- Topic: 11340 - Newspaper
- Replies: 154
- Views: 68904
Re: 11340 - Newspaper
I tried and I still get WA.brianfry713 wrote:Munchor, try making final_value long long.
But then I tried to move to unsigned char instead of char and it worked, thanks brianfry!
- Wed Mar 20, 2013 1:16 am
- Forum: Volume 105 (10500-10599)
- Topic: 10503 - The dominoes solitaire
- Replies: 16
- Views: 15515
Re: 10503 - The Dominoes Solitaire
Thank you very much!
- Wed Mar 20, 2013 12:48 am
- Forum: Volume 6 (600-699)
- Topic: 624 - CD
- Replies: 77
- Views: 46250
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 ...
- Tue Mar 19, 2013 1:51 am
- Forum: Volume 105 (10500-10599)
- Topic: 10503 - The dominoes solitaire
- Replies: 16
- Views: 15515
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 ...
#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 ...
- Wed Mar 13, 2013 11:49 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11340 - Newspaper
- Replies: 154
- Views: 68904
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 ...
#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 ...