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 ...
Search found 9 matches
- Wed Oct 01, 2008 11:23 pm
- Forum: Volume 1 (100-199)
- Topic: 102 - Ecological Bin Packing
- Replies: 485
- Views: 117408
- Mon Jan 07, 2008 5:29 am
- Forum: Volume 102 (10200-10299)
- Topic: 10213 - How Many Pieces of Land ?
- Replies: 54
- Views: 31248
- Mon Dec 17, 2007 12:20 am
- Forum: Volume 103 (10300-10399)
- Topic: 10315 - Poker Hands
- Replies: 63
- Views: 38853
- Sat Dec 15, 2007 6:01 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 319930
- Sat Dec 15, 2007 5:42 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 319930
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 ...
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 ...
- Tue Dec 11, 2007 11:56 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 319930
- Tue Dec 11, 2007 12:41 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 319930
- Sun Dec 09, 2007 7:07 am
- Forum: Bugs and suggestions
- Topic: All the dates display my birthday.
- Replies: 1
- Views: 1930
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: 319930