First, see this code.
Very simple, there are 20000 threads, named thread1 ~ thread10000 and thread1-sleep ~ thread10000-sleep .
Every thread i -sleep sleeps for 1 second and thread i interrupts it:
public class InterruptTest {
public static void main(String[] args) throws Exception {
for (int i ...
Search found 215 matches
- Wed May 04, 2011 3:48 am
- Forum: Java
- Topic: Why Some Thread.sleep() Are Not Interrupted?
- Replies: 0
- Views: 3634
- Wed Nov 05, 2008 7:47 am
- Forum: C++
- Topic: How to define a pointer to a 2-dimesional array of pointers.
- Replies: 2
- Views: 3688
Re: How to define a pointer to a 2-dimesional array of pointers.

- Wed Nov 05, 2008 6:15 am
- Forum: C++
- Topic: How to define a pointer to a 2-dimesional array of pointers.
- Replies: 2
- Views: 3688
How to define a pointer to a 2-dimesional array of pointers.
This code: #include <iostream>
using namespace std;
int main() {
int a[2][3] = { {1, 2, 3}, {4, 5, 6} };
int *(*b)[3];
for (int i = 0; i < 2; i++)
for (int j = 0; j < 3; j++)
b[i][j] = &a[i][j];
for (int i = 0; i < 2; i++)
for (int j = 0; j < 3; j++)
cout << *b[i][j] << " ";
cout << endl ...
using namespace std;
int main() {
int a[2][3] = { {1, 2, 3}, {4, 5, 6} };
int *(*b)[3];
for (int i = 0; i < 2; i++)
for (int j = 0; j < 3; j++)
b[i][j] = &a[i][j];
for (int i = 0; i < 2; i++)
for (int j = 0; j < 3; j++)
cout << *b[i][j] << " ";
cout << endl ...
- Wed Sep 17, 2008 8:19 am
- Forum: Volume 7 (700-799)
- Topic: 746 - Polygon Visibility
- Replies: 2
- Views: 3698
Re: 746 - Polygon Visibility
I've found where I was wrong and I get AC now. This input:
The output should be:
But my old program output:
Code: Select all
3 4
20001 3
30001 4
30001 2
10001 4
10001 2
1 1
1 5
0 0
Code: Select all
Instance 1:
0.000
30001 4
30001 2
0.000
Code: Select all
Instance 1:
0.000
30001 4
30001 2
-0.000
- Mon Sep 15, 2008 4:51 pm
- Forum: Volume 7 (700-799)
- Topic: 746 - Polygon Visibility
- Replies: 2
- Views: 3698
If any body get AC, please check my output below.
I just wrote a brute force, enumerated every pair of vertices of the two polygons and find the LEFTMOST and RIGHTMOST line segment, comparing by CROSS PRODUCT. I got WA but not TLE. Could any body who has got AC check my output below?
Input: 3 3
3 2
5 3
5 1
1 2
2 3
2 1
4 3
3 4
4 5
4 1
3 2
2 3
1 2 ...
Input: 3 3
3 2
5 3
5 1
1 2
2 3
2 1
4 3
3 4
4 5
4 1
3 2
2 3
1 2 ...
- Tue Jan 22, 2008 5:26 pm
- Forum: Volume 9 (900-999)
- Topic: 963 - Spelling Corrector
- Replies: 11
- Views: 8491
- Mon Jan 21, 2008 10:09 am
- Forum: Volume 9 (900-999)
- Topic: 963 - Spelling Corrector
- Replies: 11
- Views: 8491
- Mon Jan 21, 2008 10:02 am
- Forum: Volume 9 (900-999)
- Topic: 963 - Spelling Corrector
- Replies: 11
- Views: 8491
- Sun Jan 20, 2008 11:23 am
- Forum: Volume 9 (900-999)
- Topic: 963 - Spelling Corrector
- Replies: 11
- Views: 8491
963 - Spelling Corrector
Who can give some hints about the algorithm?
- Sat Nov 24, 2007 11:37 am
- Forum: Algorithms
- Topic: Suffix tree construction
- Replies: 13
- Views: 6179
I find a good paper for this subject:
E. Ukkonen: On-line construction of suffix-trees. Algorithmica 14 (1995), 249-260.
from http://www.cs.helsinki.fi/u/ukkonen/.
E. Ukkonen: On-line construction of suffix-trees. Algorithmica 14 (1995), 249-260.
from http://www.cs.helsinki.fi/u/ukkonen/.
- Thu Nov 22, 2007 4:06 pm
- Forum: C++
- Topic: Initializing member arrays in constructors
- Replies: 1
- Views: 2131
Initializing member arrays in constructors
In this code:
Is there any way to initialize the array a in the constructor like the ":b(1)"? I tried "a({0})" and "a(0)" but failed.
Code: Select all
class C {
int a[10];
int b;
C(): b(1) {}
}
- Tue Nov 20, 2007 4:27 pm
- Forum: Algorithms
- Topic: Suffix tree construction
- Replies: 13
- Views: 6179
- Tue Nov 20, 2007 9:07 am
- Forum: Algorithms
- Topic: Suffix tree construction
- Replies: 13
- Views: 6179
I want to say sorry to those to whom I send the book. I found the djvu file is not complete. It just has the first 6 chapters.
I have another pdf version of it, which is not complete either, but has the first 12 chapters. That's enough for the contents of suffix tree.
But the pdf file is 15 Mb. It's ...
I have another pdf version of it, which is not complete either, but has the first 12 chapters. That's enough for the contents of suffix tree.
But the pdf file is 15 Mb. It's ...
- Mon Nov 19, 2007 5:08 pm
- Forum: Volume 107 (10700-10799)
- Topic: 10740 - Not the Best
- Replies: 23
- Views: 17023
I use the MPS algorithm introduced in the article The K shortest paths problem from this page. It's fast.
- Thu Nov 15, 2007 4:55 am
- Forum: Algorithms
- Topic: Suffix tree construction
- Replies: 13
- Views: 6179