fork download
  1. program ideone;
  2. var
  3. f,g:textfile;
  4. a:array[1..1000] of integer;
  5. b:array[1..1000,1..1000] of integer;
  6. i,j,n,m,lim,k,z:integer;
  7. begin
  8. assignfile(f);
  9. assignfile(g);
  10. reset(f);
  11. rewrite(g);
  12.  
  13. read(f,n);
  14. read(f,lim);
  15. readln(m);
  16.  
  17. for i:=1 to n do
  18. read(a[i]);
  19.  
  20. for i:=1 to n do
  21. for j:=1 to m do
  22. read(b[i,j]);
  23. k:=lim; z:=0;
  24. for i:=1 to n do
  25. begin
  26. k:=lim;
  27. for j:=1 to m do
  28. begin
  29. if k=0 then
  30. break;
  31. if a[b[i,j]]<>0 then
  32. begin
  33. a[b[i,j]]:=a[b[i,j]]-1;
  34. z:=z+1;
  35. k:=k-1;
  36. end;
  37. end;
  38. write(g,z);
  39.  
  40.  
  41.  
  42.  
  43. closefile(f);
  44. closefile(g);
  45. end.
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.pas(8,12) Error: Identifier not found "assignfile"
prog.pas(9,12) Error: Identifier not found "assignfile"
prog.pas(43,14) Error: Identifier not found "closefile"
prog.pas(44,14) Error: Identifier not found "closefile"
prog.pas(45,4) Fatal: Syntax error, ";" expected but "." found
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)
stdout
Standard output is empty