Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Help with test cases. [Pascal]
Author Message
HeavenAgain

Posted: Sat Dec 08, 2007 10:38 pm   Post subject: RE:Help with test cases. [Pascal]

UHHH no ideaaaaa what the heck is 216 (thank god java have this short note on the error for easy debug), but just a tip when doing that question, the 2 number x and y which are being inputed, x and be bigger than y and y can be bigger than x, that should not affect your answer tho

CodeMonkey2000

Posted: Sat Dec 08, 2007 10:46 pm   Post subject: RE:Help with test cases. [Pascal]

Apparently there are two cases that give you an infinite loop, they are 113383 and 134379.
HeavenAgain

Posted: Sat Dec 08, 2007 10:48 pm   Post subject: RE:Help with test cases. [Pascal]

hey codemonkey i just found this :p check it out
http://acm.uva.es/problemset/pascalgpc.html

and no they dont give you infinte loop, if they do, you'll be rich! it is been proven that any sets of number under 1 million are possibile
and result for 113383 and 134379 should give you 349

Ps. if you use brute force for this question (3n+1), IT may require some bitwise operator, just to speed up the calculation, or else you might exceed the time limit, altho pascal and c/c++ are quite fast at these, so it shouldnt be a big problem
CodeMonkey2000

Posted: Sat Dec 15, 2007 2:24 pm   Post subject: Re: Help with test cases. [Pascal]

I finally got AC for the 3n+1 problem. I just had to rewrite the code in c++ But the minesweeper problem is still giving me WA. I really don't know what's wrong. Did you get AC?
 Cplusplus: #include bool inBounds(long x,long y, long highX,long highY) {         return ((x>0)&&(x<=highX)&&(y>0)&&(y<=highY)); } int main() {         long n,m,mines,field;         char input[1001][101],tmp;         field=1;         while ((std::cin>>n>>m)&&((n!=0)||(m!=0)))         {                 for (int x=1; x<=n; x++)                         for (int y=1; y<=m; y++)                         {                                 std::cin>>tmp;                                 while(tmp=='\n')                                         std::cin>>tmp;                                 input[x][y]=tmp;                         }                 std::cout<

EDIT: never mind, it works now. Just a formating problem
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 2 of 2  [ 19 Posts ]
Goto page Previous  1, 2
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: