ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1196. History Exam

why acess violation crash(if change to 1..65355 then wa on 8)
Posted by Koryakov Anton_ghost_Anigus 3 Jan 2006 21:26
program History_Exam_1196_sub2;

{$APPTYPE CONSOLE}
var arr:array[0..66000] of boolean;
n,c,cou,sov:longint;
begin
 readln(n);
 for cou:=1 to n do
 begin
 readln(c);
 arr[c]:=true;
 end;
 readln(n);
 for cou:=1 to n do
 begin
 readln(c);
 if arr[c]=true then inc(sov);
 end;
 writeln(sov);

end.
Array of bool is not working here: "Every year in list doesn't exceed 10^9" (-)
Posted by Dmitry 'Diman_YES' Kovalioff 3 Jan 2006 23:33
Re: why acess violation crash(if change to 1..65355 then wa on 8)
Posted by Ignat Zakrevsky 18 Feb 2007 01:07
var arr:array[0..66000] of boolean;
but true
var arr:array[0..1000000000] of boolean;
And you got AC
Re: why acess violation crash(if change to 1..65355 then wa on 8)
Posted by KIRILL(ArcSTU) 18 Feb 2007 01:16
Ignat Zakrevsky wrote 18 February 2007 01:07
var arr:array[0..66000] of boolean;
but true
var arr:array[0..1000000000] of boolean;
And you got AC

Yes, of course he will get AC :)
Re: why acess violation crash(if change to 1..65355 then wa on 8)
Posted by FireHeart 10 Jun 2007 10:16
?? Can you tell me "{$APPTYPE CONSOLE}" mean ??
Because if don't have it, my memory is more than 36000KB, but when I have it in my program, my memory is less than 500KB ??