Search found 7 matches

by yjwoo14
Mon Jan 12, 2009 6:36 am
Forum: Volume 115 (11500-11599)
Topic: 11569 - Lovely Hint
Replies: 8
Views: 2504

Re: 11569 - Lovely Hint

You can solve this problem by using DP. :D

1) Keep Length and The number of ways.

2) Are these different? (AABC, CBA ..... )
by yjwoo14
Sun Mar 16, 2008 3:43 pm
Forum: Volume 8 (800-899)
Topic: 882 - The Mailbox Manufacturers Problem
Replies: 4
Views: 5870

This is solution

matrix[i][s][l] = max[v = s ~ s + l - 1](matrix[i - 1][s][v - s] + v, matrix[i][v + 1][(s + l) - v - 1] + v)

you can get matrix[i][s][l] mean in before post.
by yjwoo14
Sun Mar 16, 2008 3:14 pm
Forum: Volume 103 (10300-10399)
Topic: 10324 - Zeros and Ones
Replies: 179
Views: 67132

Plz Help me

I don`t understand why i got WA

this is my code


#include <iostream>

#define MAXL 1000002

using namespace std;

char M[MAXL];
int L[MAXL];

int main(){
int casen = 1;
int n;
int last_fill, len;
int x, y;
char value;

while(cin >> M){
len = strlen(M);

cin >> n;
value = M[0];
last_fill ...
by yjwoo14
Fri Feb 22, 2008 4:36 am
Forum: Volume 8 (800-899)
Topic: 882 - The Mailbox Manufacturers Problem
Replies: 4
Views: 5870

You can solve problem by using DP

I got accept by using DP.

I use 3-dimension matrix.

matrix[k][s][l]

k is capcity the number of mailbox.

s is start the number of crackers

l is length...

so matrix[k][s][l] mean is i have 1 mailbox and..

minimum the number of crackers in range s, s + 1, s+ 2 , .... , (s + l - 1)

sorry I can ...
by yjwoo14
Mon Jan 14, 2008 12:51 pm
Forum: Volume 113 (11300-11399)
Topic: 11386 - Triples
Replies: 23
Views: 10981

I used STL map

I used STL map O(n^2) (or n^2lgn)

But I got TLE T_T

Is map too slow to solve this problem?

This is my code..


#include<iostream>
#include<map>

using namespace std;

int main(){
int num, cnt;
long long input;
long long max, z;
map<long long, int> M;
while (cin >> num){
cnt = 0;
max = 0 ...
by yjwoo14
Mon Jan 14, 2008 12:39 pm
Forum: Volume 100 (10000-10099)
Topic: 10099 - The Tourist Guide
Replies: 91
Views: 43153

I`ve Solved

.. Because of Initialize..

That is 2-th Array;;;;;

Couldn`t Initialize memset
by yjwoo14
Wed Jan 09, 2008 6:06 am
Forum: Volume 100 (10000-10099)
Topic: 10099 - The Tourist Guide
Replies: 91
Views: 43153

I don`t know wrong in my code

This is Floyd Version Code . This code return WA

cut after AC..,


This is BFS Version.. This code return TLE

#include <iostream>
#include <vector>
#include <queue>

#define min(x, y) (x<y)?x:y
#define MAXN 101

using namespace std;

struct node {
int first;
int second;
bool path[MAXN ...

Go to advanced search