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 ...
Search found 16 matches
- Fri May 06, 2005 9:44 pm
- Forum: Algorithms
- Topic: Help me on this problem
- Replies: 7
- Views: 2346
- Thu May 05, 2005 9:11 am
- Forum: Algorithms
- Topic: Help me on this problem
- Replies: 7
- Views: 2346
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..
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..
- Wed May 28, 2003 9:23 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318350
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 ...
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 ...
- Tue May 20, 2003 9:33 am
- Forum: Algorithms
- Topic: Branch and Bound ?
- Replies: 1
- Views: 2114
..
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 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..
- Sun May 18, 2003 6:10 am
- Forum: Volume 1 (100-199)
- Topic: 110 - Meta-Loopless Sorts
- Replies: 92
- Views: 16464
.
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 ...
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 ...
- Fri May 09, 2003 5:41 pm
- Forum: Volume 1 (100-199)
- Topic: 112 - Tree Summing
- Replies: 137
- Views: 32432
Oh, sorry
I didn't want to hurt you, Hisoka
Sorry for my rudeness
Sorry for my rudeness
- Fri May 09, 2003 4:34 pm
- Forum: Volume 1 (100-199)
- Topic: 112 - Tree Summing
- Replies: 137
- Views: 32432
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 ...
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 ...
- Wed May 07, 2003 10:13 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318350
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 ...
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 ...
- Sun May 04, 2003 3:02 pm
- Forum: Volume 1 (100-199)
- Topic: 108 - Maximum Sum
- Replies: 233
- Views: 51858
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 ...
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 ...
- Sun May 04, 2003 8:16 am
- Forum: Volume 1 (100-199)
- Topic: 108 - Maximum Sum
- Replies: 233
- Views: 51858
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 ...
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 ...
- Thu May 01, 2003 5:51 pm
- Forum: Volume 1 (100-199)
- Topic: 104 - Arbitrage
- Replies: 223
- Views: 37471
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 ...
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 ...
- Thu May 01, 2003 5:46 pm
- Forum: Volume 1 (100-199)
- Topic: 109 - SCUD Busters
- Replies: 96
- Views: 36963
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 ...
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 ...
- Thu May 01, 2003 5:44 pm
- Forum: Volume 1 (100-199)
- Topic: 109 - SCUD Busters
- Replies: 96
- Views: 36963
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 ...
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 ...
- Thu May 01, 2003 5:43 pm
- Forum: Volume 1 (100-199)
- Topic: 109 - SCUD Busters
- Replies: 96
- Views: 36963
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 ...
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 ...
- Thu May 01, 2003 5:39 pm
- Forum: Volume 1 (100-199)
- Topic: 109 - SCUD Busters
- Replies: 96
- Views: 36963
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 ...
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 ...