Skip to content

Instantly share code, notes, and snippets.

View 02015678's full-sized avatar

02015678 02015678

View GitHub Profile
@02015678
02015678 / LOOONG_ADD.pas
Created April 9, 2015 14:09
计算2个超级大数的和
var lena,lenb,len,i:integer;
s1,s2:string[101];
a,b,c:array[1..101]of integer;
ch:char;begin s1:='';
Repeat
read(ch);
IF ch<>' ' THEN s1:=s1+ch;
Until ch=' ';
readln(s2);
@02015678
02015678 / TRAIN_TRANSFER.pas
Created April 9, 2015 13:59
火车转轨/铁轨 (题目来源:UVA Problem Archive)
Const maxn=1000;
Var
x,y,i,j,n:1..maxn+1;{x:待出轨火车 y:待入轨火车}
d,a:array[1..maxn+1]OF 1..maxn;{a:原进站顺序 d:中间栈}
top:0..maxn+1;{栈顶指针}
Begin
readln(n);
For i:=1 to n do read(a[i]);
top:=0; x:=1; j:=1; y:=a[j];
For i:=1 to 2*n+1 do
@02015678
02015678 / VISATYPE.H
Last active August 29, 2015 14:18
Fundamental VISA data types and macro definitions
/*---------------------------------------------------------------------------*/
/* Distributed by IVI Foundation Inc. */
/* */
/* Do not modify the contents of this file. */
/*---------------------------------------------------------------------------*/
/* */
/* Title : VISATYPE.H */
/* Date : 05-12-2009 */
/* Purpose : Fundamental VISA data types and macro definitions */
/* */
@02015678
02015678 / VISA.H
Last active August 29, 2015 14:18
Include file for the VISA Library 4.0 specification
/*---------------------------------------------------------------------------*/
/* Distributed by the IVI Foundation */
/* */
/* Do not modify the contents of this file. */
/*---------------------------------------------------------------------------*/
/* */
/* Title : VISA.H */
/* Date : 06-18-2012 */
/* Purpose : Include file for the VISA Library 5.1 specification */
/* */
@02015678
02015678 / 2007030103.pas
Created January 23, 2015 13:20
NK1002 NKPC1 Lucy's Problem
Var
x:array[1..15]OF longint;
i,n:integer;
Function cal(x:longint):longint;
Begin
IF x>=50025002
THEN cal:=x-5
ELSE
Begin
repeat
@02015678
02015678 / 2007030102.pas
Created January 23, 2015 13:15
02015678's Solution for NK1009 NKPC2 Lucy's Problem
Var
s1,s2,s3,s4:string;
n1,n2,n3:longint;
ch:char;
code,n,i,j:integer;
num:array[1..12] OF 0..9;
Begin
s1:='';s2:='';s3:='';s4:='';
fillchar(num,sizeof(num),0);
repeat
@02015678
02015678 / 2007030101.pas
Last active August 29, 2015 14:14
NK1009 NKPC2 Lucy's Problem Liuhy Solution
Var
a,b,m:string;
i:integer;
x,y:longint;
Procedure f(var n:string);
Begin
m:='';For i:=length(n) downto 1 do m:=m+n[i];n:=m;
End;
BEGIN
readln(a);
@02015678
02015678 / 2007050301.pas
Last active August 29, 2015 14:14
Translation between different Positional notations 负进制转换 NOIP 2000-1
//https://joeyaochou.wordpress.com/2015/01/23/translation-between-different-positional-notations-%E8%B4%9F%E8%BF%9B%E5%88%B6%E8%BD%AC%E6%8D%A2-noip-2000-1/
const
maxn=50;{数组限制}
ch:string[20]='0123456789ABCDEFGHIJ';{A=10 B=11 ...}
var
i,j,n,m,k:longint;
bit:array[0..maxn] of longint;
{纪录每一位的 纯数值(A B...暂用数值表示)}
begin
@02015678
02015678 / 2007082602.pas
Created January 23, 2015 12:54
NKOJ 1781: ISBN Liuhy
program ISBN;
uses CRT;
var
d:array [1..10] of integer;
i,unk,sumn,ans,t:integer;
b:boolean; s:string;
begin
sumn:=0;
readln(s);
for i:=1 to 10 do
@02015678
02015678 / 2007082601.pas
Created January 23, 2015 12:53
NKOJ 1781: ISBN
Var
a:array[1..10]OF 0..10;
str:string;
n,i,s:integer;
Function cal(x,y:integer):integer;
Var
i:integer;
ans:integer;
Begin
ans:=0;