Search found 3 matches

by QwertyKzk
Mon Jan 03, 2005 10:29 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 197514

program p100; var N1,N2,count,solve1:longint; mass1,mass2,mass3:array[1..1000000] of longint; function Solve(N,k:longint):longint; var i,j,res:longint; begin solve1:=0; if N<K then Begin FOR j:=n TO k DO begin i:=j; Res:=0; while i>1 do begin if odd(i) then i:=i*3+1 else I:=I div 2; Inc(res); end; ...
by QwertyKzk
Sun Jan 02, 2005 4:18 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 197514

program problem_100; var N1,N2,count,solve1:longint; mass1,mass2,mass3:array[1..100] of longint; function Solve(N,k:longint):longint; var i,j,res:longint; begin solve1:=0; FOR j:=n TO k DO begin i:=j; Res:=0; while i>1 do begin if odd(i) then i:=i*3+1 else I:=I div 2; Inc(res); end; if res>solve1 t...
by QwertyKzk
Sun Jan 02, 2005 4:10 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 197514

T_T I get WA, shy (( var N1,N2,solve1:longint; function Solve(N,k:longint):longint; var i,j,res:longint; begin solve1:=0; FOR j:=n TO k DO begin i:=j; Res:=0; while i>1 do begin if odd(i) then i:=i*3+1 else I:=I div 2; Inc(res); end; if res>solve1 then solve1:=res end; result:=solve1; end; begin whi...

Go to advanced search