Search found 16 matches

by Diskerr
Fri May 06, 2005 9:44 pm
Forum: Algorithms
Topic: Help me on this problem
Replies: 7
Views: 1424

Maybe mf is right! If there are two distinct cores, their union is also core! (voted, like someone in it, liked by someone in it!) To tell the truth, I participated in this contest(2003 ACM ICPC ASIA Regional Seoul). In our contest, N = 10000 means that the problem has O(N) or O(N log N) bound, and ...
by Diskerr
Thu May 05, 2005 9:11 am
Forum: Algorithms
Topic: Help me on this problem
Replies: 7
Views: 1424

Help me on this problem

Link : http://acmicpc-live-archive.uva.es/nuev ... php?p=2809

I think that it is a kind of well-known graph problem, but I have completely no idea. Give me some idea please.

N = 10,000 means it can be solved in O(N) time..
by Diskerr
Wed May 28, 2003 9:23 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 189276

It

It is just a trick to maximize speed. Between 1 and 1000000, 837799 gives the longest sequence of 525. So, if the pair (nFrom, nTo) includes 837799, answer is clearly 525, and we need not do any calculations. This problem is very easy to solve. But unless you think with care, you will got WA. Consid...
by Diskerr
Tue May 20, 2003 9:33 am
Forum: Algorithms
Topic: Branch and Bound ?
Replies: 1
Views: 1787

..

Foundations of Algorithms Using C++ Pseudocode, Second Edition
by Richard E. Neapolitan, Kumarss Naimipour

It has a chapter related to branch and bound.

Yes.. branch and bound is more efficient method to prune unpromissing nodes than backtracking in exhaustive search..
by Diskerr
Sun May 18, 2003 6:10 am
Forum: Volume 1 (100-199)
Topic: 110 - Meta-Loopless Sorts
Replies: 92
Views: 8192

.

Multiple input consists of T <- the number of test cases (A blank line) Single test case 1 (A blank line) Single test case 2 . . . Single test case T so, you must output following : Answer for test case 1 (A blank line) . . . Answer for test case T (If here exists a blank line, you will get PE) Samp...
by Diskerr
Fri May 09, 2003 5:41 pm
Forum: Volume 1 (100-199)
Topic: 112 - Tree Summing
Replies: 137
Views: 14684

Oh, sorry

I didn't want to hurt you, Hisoka

Sorry for my rudeness
by Diskerr
Fri May 09, 2003 4:34 pm
Forum: Volume 1 (100-199)
Topic: 112 - Tree Summing
Replies: 137
Views: 14684

Prob 112. Tree Summing, I got TLE.

I've searched all of the articles related to prob 102, but there were no one who got TLE. My idea is : 1. Build tree from string 2. Find all of the possible combinations to make I (integer) through "INORDER" tree traverse. but I got TLE. It works fine in negative inputs. I think that if we want to f...
by Diskerr
Wed May 07, 2003 10:13 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 189276

The problem is..

The reason you got WA is that you didn't handle the input correctly. Use this code instead of yours : [java]public static void main(String[] args) { memory=new long[1000000]; String input=""; String in1; while((in1=readLine(255))!=null) { input = in1; StringTokenizer st=new StringTokenizer(input); t...
by Diskerr
Sun May 04, 2003 3:02 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 24192

Thanks a lot!

I got AC at once with your comment! :D It helps me a lot! Thanks again.. And, is there any possibilities to improve this code? I seldom care about the CPU time, but, this code is very slow. (The CPU time was 0.050.. but there are many 0.20 - 0.30 rankers.. I heard that O(N^3) algo is the most effice...
by Diskerr
Sun May 04, 2003 8:16 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 24192

Prob 108. What is the O(n^3) algo? who can explain it to me?

Hello, I tried to solve prob 108, and I found the O(n^6) algo. (Brute Force) But it would get TLE. I heard there exists O(n^3) algo. I want to know it. There general idea is DP. We can use one dimension result. I know how to get maximum sum from 1 dim, but how it can be applicable to 2 dim problem? ...
by Diskerr
Thu May 01, 2003 5:51 pm
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 14813

DFS..

I think that this prob can't be solved by DFS. If there are 20 nodes and 19 edges for each nodes, how can be DFS works? (It takes factorial time!) Use DP. I heard Floyd-Warshall(O^3) works fine for this problem. But for me, I have no idea how it can be applicable. So I modified Floyd-warshall, it ta...
by Diskerr
Thu May 01, 2003 5:46 pm
Forum: Volume 1 (100-199)
Topic: 109 - SCUD Busters
Replies: 96
Views: 24938

Prob 109 need some help..

I have tried to solve prob 109 several times, but I always get WA. this is my source code : [cpp] #include <iostream> #include <vector> #include <iomanip> #include <cmath> using namespace std; struct Point { int x; int y; }; struct Kingdom { int N; Point p[100]; vector<int> CH; bool Destroyed; }; bo...
by Diskerr
Thu May 01, 2003 5:44 pm
Forum: Volume 1 (100-199)
Topic: 109 - SCUD Busters
Replies: 96
Views: 24938

Prob 109 need some help..

I have tried to solve prob 109 several times, but I always get WA. this is my source code : [cpp] #include <iostream> #include <vector> #include <iomanip> #include <cmath> using namespace std; struct Point { int x; int y; }; struct Kingdom { int N; Point p[100]; vector<int> CH; bool Destroyed; }; bo...
by Diskerr
Thu May 01, 2003 5:43 pm
Forum: Volume 1 (100-199)
Topic: 109 - SCUD Busters
Replies: 96
Views: 24938

Prob 109 need some help..

I have tried to solve prob 109 several times, but I always get WA. this is my source code : [cpp]#include <iostream> #include <vector> #include <iomanip> #include <cmath> using namespace std; struct Point { int x; int y; }; struct Kingdom { int N; Point p[100]; vector<int> CH; bool Destroyed; }; boo...
by Diskerr
Thu May 01, 2003 5:39 pm
Forum: Volume 1 (100-199)
Topic: 109 - SCUD Busters
Replies: 96
Views: 24938

Prob 109 need some help..

I have tried to solve prob 109 several times, but I always get WA. this is my source code : [cpp]#include <iostream> #include <vector> #include <iomanip> #include <cmath> using namespace std; struct Point { int x; int y; }; struct Kingdom { int N; Point p[100]; vector<int> CH; bool Destroyed; }; boo...

Go to advanced search