Search found 7 matches
- Fri Mar 25, 2005 10:13 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10515 - Powers Et Al.
- Replies: 124
- Views: 45300
Re: 10515 - WA, why? this is imposible!!!!!!!!!!!!!!
The Timus board is much more active.
- Wed Mar 23, 2005 11:25 am
- Forum: Volume 1 (100-199)
- Topic: 108 - Maximum Sum
- Replies: 233
- Views: 51719
108 Maximum sum - Time limit exeeded
Hye, I have a problem (time limit exedeed). I used a O^6 algoritm and I need help In makeing a faster algoritm.
Here is my code:
var n,i,j,k,r,suma,yes,max:longint;
nr:array[1..110,1..110] of longint;
function sumarit(i1,j1,i2,j2:longint):longint;
var i,j,suma:longint;
begin
suma:=0;
for i:=i1 ...
Here is my code:
var n,i,j,k,r,suma,yes,max:longint;
nr:array[1..110,1..110] of longint;
function sumarit(i1,j1,i2,j2:longint):longint;
var i,j,suma:longint;
begin
suma:=0;
for i:=i1 ...
- Fri Mar 18, 2005 1:04 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10593 - Kites
- Replies: 18
- Views: 8915
Re: 10593 HELP!!
Hi all,
I really got nervous about this problem! It's not deficult! I tested for all inputs on board, but still WA. There shouldn't be any special traps, or sth...
Please, HELP
My code:
const
max = 500;
type
cat = record
k,r:boolean;
end;
var
a,i,j,n,wyn:longint;
t:array[1..max,1..max]of ...
I really got nervous about this problem! It's not deficult! I tested for all inputs on board, but still WA. There shouldn't be any special traps, or sth...
Please, HELP
My code:
const
max = 500;
type
cat = record
k,r:boolean;
end;
var
a,i,j,n,wyn:longint;
t:array[1..max,1..max]of ...
- Thu Mar 17, 2005 8:13 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10515 - Powers Et Al.
- Replies: 124
- Views: 45300
Re: 10515 - WA, why? this is imposible!!!!!!!!!!!!!!
Code: Select all
Please help, I need an explination, I realy need an explination, please I need help!!!!!!
- Thu Mar 17, 2005 5:29 pm
- Forum: Volume 1 (100-199)
- Topic: 160 - Factors and Factorials
- Replies: 205
- Views: 45151
Re: Why "Floating point exception"---problem 160
Trie this source, try not to use iostream.h but fstream.h
#include <fstream>
using namespace std;
unsigned long primeTable[25]={2,3,5,7,
11,13,17,19,
23,29,
31,37,
41,43,47,
53,59,
61,67,
71,73,79,
83,89,
97};
unsigned long func(unsigned long n,unsigned long p)
{
unsigned long i=0 ...
#include <fstream>
using namespace std;
unsigned long primeTable[25]={2,3,5,7,
11,13,17,19,
23,29,
31,37,
41,43,47,
53,59,
61,67,
71,73,79,
83,89,
97};
unsigned long func(unsigned long n,unsigned long p)
{
unsigned long i=0 ...
- Thu Mar 17, 2005 5:26 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 317957
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 ...
- Thu Mar 17, 2005 3:23 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10515 - Powers Et Al.
- Replies: 124
- Views: 45300
10515 - WA, why? this is imposible!!!!!!!!!!!!!!
type vec=array[1..3000] of byte;
var a,rez,poz,i,m,r:longint;
code:integer;
b:vec;
x,y,z:string;
function rest(a:vec; x:longint):longint;
var i:integer;
begin
r:=0;
for i:=m downto 1 do
r:=(10*r+a ) mod x;
rest:=r;
end;
begin
while not eof do
begin
readln(z);
if (z='0 0') then halt ...
var a,rez,poz,i,m,r:longint;
code:integer;
b:vec;
x,y,z:string;
function rest(a:vec; x:longint):longint;
var i:integer;
begin
r:=0;
for i:=m downto 1 do
r:=(10*r+a ) mod x;
rest:=r;
end;
begin
while not eof do
begin
readln(z);
if (z='0 0') then halt ...