if (flag2 == 0)
pts[n].x = x; pts[n].y = y; n++;
Probably should be if (flag2 == 0){
pts[n].x = x; pts[n].y = y; n++;
}
BTW, GCD is unnecessary. In fact, it is not obvious to me that this algorithm is correct. I used another: #include <list>
#include <vector>
#include <utility>
using namespace ...
Search found 15 matches
- Thu Jul 07, 2005 9:30 pm
- Forum: Volume 1 (100-199)
- Topic: 184 - Laser Lines
- Replies: 15
- Views: 3892
- Wed Jul 06, 2005 2:51 pm
- Forum: Volume 1 (100-199)
- Topic: 184 - Laser Lines
- Replies: 15
- Views: 3892
- Sat Jan 03, 2004 9:39 am
- Forum: Volume 1 (100-199)
- Topic: 103 - Stacking Boxes
- Replies: 200
- Views: 50442
Babelfish's English is much better than mine.
- Thu Jan 01, 2004 5:09 pm
- Forum: Volume 1 (100-199)
- Topic: 103 - Stacking Boxes
- Replies: 200
- Views: 50442
- Sat Aug 16, 2003 6:56 am
- Forum: Volume 1 (100-199)
- Topic: 199 - Partial differential equations
- Replies: 15
- Views: 6516
- Fri Aug 15, 2003 4:51 am
- Forum: Java
- Topic: Anyone who use Java?
- Replies: 3
- Views: 1390
Re: Anyone who use Java?
Zhao Le, take a look at this thread.
- Fri Aug 15, 2003 4:47 am
- Forum: Volume 1 (100-199)
- Topic: 199 - Partial differential equations
- Replies: 15
- Views: 6516
So could you sum up what is the problem?
OJ's C++ compiler cannot compile many programs which I think it should, since other ANSI C++ compilers which I tried can (Borland C++ 5.5, ANSI mode; Comeau C++ 4.3.3 BETA at http://www.comeaucomputing.com/tryitout/, C++ mode strict, no -tused). If anyone ...
OJ's C++ compiler cannot compile many programs which I think it should, since other ANSI C++ compilers which I tried can (Borland C++ 5.5, ANSI mode; Comeau C++ 4.3.3 BETA at http://www.comeaucomputing.com/tryitout/, C++ mode strict, no -tused). If anyone ...
- Thu Aug 14, 2003 7:17 am
- Forum: Volume 1 (100-199)
- Topic: 112 - Tree Summing
- Replies: 137
- Views: 32389
Re: 112 - help me. plz
I tested your program with random data; some tests for which your program produced wrong results are:
8(8(2(1()())())())
8(8(3(7()())())())
4(4(2(4()())())())
5(5(4()(1(7(3()())(4()()))(4(3()())())))())
21(7()(5()(5()(4(1(7()())())()))))
47(7(9()(1(4()(7()(5(9(3(4(10()())())())(5(9(5(6(3(1(9()(2(3 ...
8(8(2(1()())())())
8(8(3(7()())())())
4(4(2(4()())())())
5(5(4()(1(7(3()())(4()()))(4(3()())())))())
21(7()(5()(5()(4(1(7()())())()))))
47(7(9()(1(4()(7()(5(9(3(4(10()())())())(5(9(5(6(3(1(9()(2(3 ...
- Mon Aug 11, 2003 6:22 am
- Forum: Other words
- Topic: (Autotester) If you keep getting WA
- Replies: 0
- Views: 796
(Autotester) If you keep getting WA
...and decided to post your code and ask for more test inputs/outputs, you will probably find this thing useful:
[cpp]
#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
class Autotester{
public:
virtual void generate_test(ofstream&) = 0;
virtual void run_test ...
[cpp]
#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
class Autotester{
public:
virtual void generate_test(ofstream&) = 0;
virtual void run_test ...
- Mon Aug 11, 2003 6:20 am
- Forum: Volume 1 (100-199)
- Topic: 103 - Stacking Boxes
- Replies: 200
- Views: 50442
Re: 103 Stacking Boxes. Appeal to everyone who can help.
My old Pascal compiler said he don't know what "fillchar" is, and I already forgot the syntax... So I said #define fillchar(ARR, SIZE, VALUE) for ___idx:=1 to SIZE do ARR[___idx]:=VALUE; <evil grin> don't know if it is correct or not...
So he compiled the code, and for this test:
17 4
859 397 577 ...
So he compiled the code, and for this test:
17 4
859 397 577 ...
- Mon Aug 11, 2003 6:18 am
- Forum: Volume 1 (100-199)
- Topic: 103 - Stacking Boxes
- Replies: 200
- Views: 50442
Re: 103 - WA (i'm going crazy!) need test inputs!
danielrocha ,
Your program gave strange output for this test (run for a minute or so):
6 5
622 413 899 408 333
471 304 534 644 914
11 529 348 268 542
581 374 527 557 669
888 397 159 70 722
373 303 788 71 255
1
1
1
1
1
1
1
1
2
55 100
1
1
2
4 1
1
1
2
501 128
1
1
1
1
2
279 277
1
1
2
516 388
1
1 ...
Your program gave strange output for this test (run for a minute or so):
6 5
622 413 899 408 333
471 304 534 644 914
11 529 348 268 542
581 374 527 557 669
888 397 159 70 722
373 303 788 71 255
1
1
1
1
1
1
1
1
2
55 100
1
1
2
4 1
1
1
2
501 128
1
1
1
1
2
279 277
1
1
2
516 388
1
1 ...
- Mon Aug 11, 2003 6:17 am
- Forum: Volume 1 (100-199)
- Topic: 103 - Stacking Boxes
- Replies: 200
- Views: 50442
- Mon Aug 11, 2003 6:14 am
- Forum: Volume 1 (100-199)
- Topic: 101 - The Blocks Problem
- Replies: 635
- Views: 108923
- Sat Aug 09, 2003 9:56 am
- Forum: Volume 1 (100-199)
- Topic: 199 - Partial differential equations
- Replies: 15
- Views: 6516
- Fri Aug 08, 2003 8:19 pm
- Forum: Volume 1 (100-199)
- Topic: 199 - Partial differential equations
- Replies: 15
- Views: 6516
STL: weird compile errors (Resolved)
First of all, sorry for my English.
I keep getting weird compile errors for my programs which Borland C++ 5.5 compiles with no single warning. For example (199 Partial Differential Equations):
[cpp]
#include <algorithm>
#include <iostream>
#include <valarray>
#include <numeric>
using namespace std ...
I keep getting weird compile errors for my programs which Borland C++ 5.5 compiles with no single warning. For example (199 Partial Differential Equations):
[cpp]
#include <algorithm>
#include <iostream>
#include <valarray>
#include <numeric>
using namespace std ...