For Free pascal

Revision en3, by Zung04052000, 2015-12-14 06:32:07

{$MODE OBJFPC}

{$COPERATORS ON}

uses math;

const

{$IFDEF ONLINE_JUDGE}

{$R-,Q-,S-,I-}

{$OPTIMIZATION LEVEL2}

{$INLINE ON}

Fi      = '';           
    Fo      = '';

{$ELSE}

{$INLINE OFF}

Fi      = 'GCDLCM.inp'; // this is the file you use when judging in your computer
    Fo      = 'GCDLCM.Out';

{$ENDIF}

begin

assign(input, fi); reset(input);

assign(output,fo); rewrite(output);

end.


I get tired of forgetting to delete or turn off the open and the close file before submitting to Codeforces or anywhere else and the result is I sometime get 'compiler error', so this is what I do to make sure that won't happen again. Although it looks kinda complicated and long too but it is really useful for me when testing a big input (like some graph problems) and I don't have to hide or change the input and output files anymore.


{__for someone don't know__}

The {$coperators on} there is used for some 'arithmetic expression' like :

a:=1; a+=1; // a=2

a:=3; a*=3; // a=9

a:=3; a-=1; // a=2

... I think it types faster than use a:=a+?; (if the variable is long)

{____}


If you have another way to do, you can share with everyone bellow =)), hope you find this post something useful !

Also, this code wasn't me, it's from my teacher, his nick is 'lmhoang' and he allowed me to post this.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Zung04052000 2015-12-14 06:32:56 6 Tiny change: 'testing a big input (li' -> 'testing a large input (li'
en3 English Zung04052000 2015-12-14 06:32:07 19
en2 English Zung04052000 2015-12-14 06:26:30 75
en1 English Zung04052000 2015-12-14 06:23:32 1561 Initial revision (published)