Search found 9 matches
- Wed Oct 01, 2008 11:23 pm
- Forum: Volume 1 (100-199)
- Topic: 102 - Ecological Bin Packing
- Replies: 485
- Views: 73297
Re: Wrong Answer for 102
Why do I keep getting WA? #include <iostream> #include <string> using namespace std; int main() { int B[3],G[3],C[3]; long BGC,BCG,CGB,CBG,GBC,GCB; while(cin>>B[0]>>G[0]>>C[0]>>B[1]>>G[1]>>C[1]>>B[2]>>G[2]>>C[2]) { BCG=G[0]+C[0]+ B[1]+G[1]+ B[2]+C[2]; BGC=G[0]+C[0]+ B[1]+C[1]+ B[2]+G[2]; CBG=G[0]+B[...
- Mon Jan 07, 2008 5:29 am
- Forum: Volume 102 (10200-10299)
- Topic: 10213 - How Many Pieces of Land ?
- Replies: 54
- Views: 24043
- Mon Dec 17, 2007 12:20 am
- Forum: Volume 103 (10300-10399)
- Topic: 10315 - Poker Hands
- Replies: 63
- Views: 29669
- Sat Dec 15, 2007 6:01 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 213526
- Sat Dec 15, 2007 5:42 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 213526
Re: If you get WA in problem 100, read me before post!
This problem is really tuff, even if it is the first one, anyway here is a source code, it got AC. var i, j: integer; function getCL(N: integer): integer; var k: integer; begin k := 1; while N <> 1 do begin if odd(N) then N := 3*N + 1 else N := N div 2; k := k + 1; end; getCL := k; end; function ge...
- Tue Dec 11, 2007 11:56 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 213526
- Tue Dec 11, 2007 12:41 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 213526
- Sun Dec 09, 2007 7:07 am
- Forum: Bugs and suggestions
- Topic: All the dates display my birthday.
- Replies: 1
- Views: 1649
All the dates display my birthday.
All the dates display my birth day. THis is just weird.
- Sun Dec 09, 2007 6:56 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 213526
I keep getting time limit exceeded. I don't know how to make this code any more efficient. Am I missing something? :S uses crt; var i,j,max,x,tmp:longInt; function foo(a:longInt):longInt; var x,c:longInt; begin x:=a; c:=1; while (x<>1) do begin if ((x mod 2) =0) then x:=x div 2 else x:=x*3+1; c:=c+1...