Signed-off-by: sairate <sairate@sina.cn>

This commit is contained in:
sairate 2025-06-01 10:44:01 +08:00
commit 14d4894861
3744 changed files with 15823433 additions and 0 deletions

View File

@ -0,0 +1,33 @@
#include<iostream>
#include<cstring>
using namespace std;
int a[100000],n,i,y,xy[100000];
int main()
{
cin>>n;
a[0]=1;
a[1]=1;
for (y=1;y<=n;y++)
{
memset(xy,0,sizeof(xy));
xy[0]=a[0];
for (i=1;i<=a[0];i++)
{
xy[i]+=a[i]*y;
xy[i+1]=xy[i]/10;
xy[i]%=10;
}
while (xy[xy[0]+1]>0)
{
xy[xy[0]+2]=xy[xy[0]+1]/10;
xy[xy[0]+1]%=10;
xy[0]++;
}
for (i=1;i<=xy[0];i++) a[i]=xy[i];
a[0]=xy[0];
}
for (i=a[0];i>=1;i--) cout<<a[i];
cout<<endl;
return 0;
}

View File

@ -0,0 +1,34 @@
var
i,j,n,w : longint;
a : array[1..1000] of integer;
procedure fact(k : longint);
var
x,i : longint;
begin
x := 0;
for i := 1 to w do
begin
a[i] := a[i]*k+x;
x := a[i] div 10;
a[i] := a[i] mod 10;
end;
while x>0 DO
begin
w := w+1;
a[w] := x mod 10;
x := x div 10;
end;
end;
begin
assign(input,'ni.in'); reset(input);
assign(output,'ni.out'); rewrite(output);
a[1] := 1;
w := 1;
readln(n);
for i := 1 to n do fact(i);
for j := w downto 1 do write(a[j]);
writeln;
close(input); close(output);
end.

View File

@ -0,0 +1 @@
3628800

View File

@ -0,0 +1 @@
2432902008176640000

View File

@ -0,0 +1 @@
12696403353658275925965100847566516959580321051449436762275840000000000000

View File

@ -0,0 +1 @@
185482642257398439114796845645546284380220968949399346684421580986889562184028199319100141244804501828416633516851200000000000000000000

View File

@ -0,0 +1 @@
14872707060906857289084508911813048098675809251055070300508818286592035566485075754388082124671571841702793317081960037166525246368924700537538282948117301741317436012998958826217903503076596121600000000000000000000000000000000

View File

@ -0,0 +1 @@
24215638650792346558700053691985855570120556040258652734839783267039961720178323593174739047913617079695531502689473012213820889134885853992818438056445080201482863675240494802269823110125881000284687377104376400792200165127855908498047507347955446603093964326987087311394274684237308398502911304969719715098068025497504900730580217016573270011698467378924291550780873605154736879542602554635558428265690302091342359471863508627516511203478353542187151045838267239168928747525890559708487655213488727530884968558716385000436989129479527833010340517760688345368715729020015336862534353876914871201776699205878662858555857265544230999178449256448000000000000000000000000000000000000000000000000000000000000000000000000000000000000

View File

@ -0,0 +1,30 @@
#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n,m,i;
cin>>n>>m;
printf("%d/%d=%d.",n,m,n/m);
n%=m;
for (i=1;i<=20;i++)
{
n*=10;
printf("%d",n/m);
n%=m;
if (n==0) break;
}
printf("\n");
return 0;
}

View File

@ -0,0 +1,21 @@
var
a,b,i,k,len : integer;
m : array[1..20] of integer;
begin
assign(input,'ab.in'); reset(input);
assign(output,'ab.out'); rewrite(output);
read(a,b);
write(a,'/',b,'=',a div b,'.');
k := a mod b;
for i := 1 to 20 do
begin
m[i] := 10*k div b;
k := 10*k mod b;
end;
len := 20;
while (m[len]=0)and(len>1) do dec(len);
for i:=1 to len do
write(m[i]);
writeln;
close(input); close(output);
end.

View File

@ -0,0 +1 @@
4/3=1.33333333333333333333

View File

@ -0,0 +1 @@
12/7=1.71428571428571428571

View File

@ -0,0 +1 @@
8/3=2.66666666666666666666

View File

@ -0,0 +1 @@
1034 1033

View File

@ -0,0 +1 @@
1034/1033=1.000968054211035818

View File

@ -0,0 +1,27 @@
#include<iostream>
using namespace std;
int n,i,j,a[15],b[15],l=15;
int main()
{
cin>>n; b[1]=6;
for(i=4; i<=n; i++)
{
a[1]=i%100000%10000%1000%100%10;
a[2]=i%100000%10000%1000%100/10;
a[3]=i%100000%10000%1000/100;
a[4]=i%100000%10000/1000;
a[5]=i%100000/10000;
a[6]=i/100000;
for(j=1; j<=l; j++)
{
b[j]=b[j]+a[j];
if(b[j]>9)
{
b[j]=b[j]%10;
b[j+1]=b[j+1]+1;
}
}
}
while((l>1)&&(b[l]==0)) l--;
for(i=l; i>=1; i--) cout<<b[i];
}

View File

@ -0,0 +1,29 @@
program ex3;
var
i,w,n : longint;
a : array[1..100] of longint;
procedure jia(k : longint);
var
j,x : longint;
begin
x := a[1]+k;
w := 0;
while x>0 do
begin
w := w+1;
a[w] := x mod 10;
x := a[w+1]+x div 10;
end;
end;
begin
assign(input,'ja.in'); reset(input);
assign(output,'ja.out'); rewrite(output);
readln(n);
w := 1;
for i := 1 to n do jia(i);
for i := w downto 1 do write(a[i]);
writeln;
close(input); close(output);
end.

View File

@ -0,0 +1 @@
888888

View File

@ -0,0 +1 @@
61382716

View File

@ -0,0 +1 @@
999999

View File

@ -0,0 +1 @@
499999500000

View File

@ -0,0 +1,56 @@
#include<iostream>
#include<cstring>
using namespace std;
int a[100000],n,i,y,xy[100000],s[100000];
void add()
{
int i;
memset(xy,0,sizeof(xy));
xy[0]=max(s[0],a[0]);
for (i=1;i<=xy[0];i++)
{
xy[i]+=s[i]+a[i];
xy[i+1]=xy[i]/10;
xy[i]%=10;
}
while (xy[xy[0]+1]>0)
{
xy[xy[0]+2]=xy[xy[0]+1]/10;
xy[xy[0]+1]%=10;
xy[0]++;
}
s[0]=xy[0];
for (i=1;i<=xy[0];i++) s[i]=xy[i];
}
int main()
{
cin>>n;
a[0]=1;
a[1]=1;
s[0]=1;
s[1]=0;
for (y=1;y<=n;y++)
{
memset(xy,0,sizeof(xy));
xy[0]=a[0];
for (i=1;i<=a[0];i++)
{
xy[i]+=a[i]*y;
xy[i+1]=xy[i]/10;
xy[i]%=10;
}
while (xy[xy[0]+1]>0)
{
xy[xy[0]+2]=xy[xy[0]+1]/10;
xy[xy[0]+1]%=10;
xy[0]++;
}
for (i=1;i<=xy[0];i++) a[i]=xy[i];
a[0]=xy[0];
add();
}
for (i=s[0];i>=1;i--) cout<<s[i];
cout<<endl;
return 0;
}

View File

@ -0,0 +1,32 @@
program jiecheng(input,output);
const max=10000;
var i,j,n : integer;
sum,fac : array[1..max+1] of integer;
begin
assign(input,'sum.in'); assign(output,'sum.out');
reset(input); rewrite(output);
read(n);
for i := 1 to max do sum[i] := 0;
for i := 1 to max do fac[i] := 0;
fac[1] := 1;
for i := 1 to n do
begin
for j := 1 to max do fac[j] := fac[j]*i;
for j := 1 to max do
begin
fac[j+1] := fac[j+1]+fac[j] div 10;
fac[j] := fac[j] mod 10;
end;
for j := 1 to max do sum[j] := sum[j]+fac[j];
for j := 1 to max do
begin
sum[j+1] := sum[j+1]+sum[j] div 10;
sum[j] := sum[j] mod 10;
end;
end;
i := max;
while sum[i]=0 do i := i-1;
for j := i downto 1 do write(sum[j]);
writeln;
close(input); close(output);
end.

View File

@ -0,0 +1 @@
254120249273735911000907888640119535236287907165951916892565760428653068358394812028951886899362211706573251799059144977163198350579476833315404394194273776708617756335498155452476066616083404064569523579235001013208442504120594016095732334057618307254825831235764323593105039052556442336528920420940313

View File

@ -0,0 +1 @@
4037913

View File

@ -0,0 +1 @@
522956313

View File

@ -0,0 +1 @@
16158688114800553828940313

View File

@ -0,0 +1 @@
537169001220328488991089808037100875620940313

View File

@ -0,0 +1 @@
31035053229546199656252032972759319953190362094566672920420940313

View File

@ -0,0 +1,3 @@
100

View File

@ -0,0 +1 @@
94269001683709979260859834124473539872070722613982672442938359305624678223479506023400294093599136466986609124347432647622826870038220556442336528920420940313

View File

@ -0,0 +1 @@
723930191979474006646854190608859789522640775146933593199410448920420940313

View File

@ -0,0 +1 @@
187614911715749685817248425941004050893848927079322281432389628090868928026359770825810501448242006058427610137151642336528920420940313

View File

@ -0,0 +1,31 @@
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int a[10000];
string s1,s2;
void addd()
{
int a1=s1.size(),a2=s2.size();
for (int i=0;i<a1;i++)
for (int j=0;j<a2;j++)
a[a1-i+a2-j-1]+=(s1[i]-'0')*(s2[j]-'0');
for (int i=1;i<=a1+a2;i++) { a[i+1]+=a[i]/10; a[i]%=10; }
a[0]=a1+a2; while (a[a[0]]==0&&a[0]>1) a[0]--;
}
int main()
{
getline(cin,s1);
getline(cin,s2);
memset(a,0,sizeof(a));
addd();
for (int i=a[0];i>=1;i--) cout<<a[i];
cout<<endl;
return 0;
}

View File

@ -0,0 +1,29 @@
program jj;
var la,lb,lc,x,i,j : longint;
a,b,c : array [1..1000] of longint;
n,m : string;
begin
assign(input,'multiply.in');
assign(output,'multiply.out');
reset(input); rewrite(output);
readln(n); readln(m);
la := length(n); lb := length(m);
for i := 1 to la do a[la-i+1] := ord(n[i])-48;
for i := 1 to lb do b[lb-i+1] := ord(m[i])-48;
for i := 1 to la do
begin
x : =0;
for j := 1 to lb do
begin
x := a[i]*b[j]+x div 10+c[i+j-1];
c[i+j-1] := x mod 10;
end;
c[i+j] := x div 10;
end;
lc := i+j;
while (c[lc]=0) and (lc>1) do lc := lc-1;
for i := lc downto 1 do
write(c[i]);
writeln;
close(input); close(output);
end.

View File

@ -0,0 +1,2 @@
3636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636
3636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636

View File

@ -0,0 +1 @@
13223140495867768595041322314049586776859504132231404958677685950413223140495867768595041322314049584132231404958677685950413223140495867768595041322314049586776859504132231404958677685950413223140496

View File

@ -0,0 +1,2 @@
223132
546493

View File

@ -0,0 +1,2 @@
3575123464611135
1546681346823682

View File

@ -0,0 +1 @@
5529576775305698493965538899070

View File

@ -0,0 +1,2 @@
1612303134360325403163115126153055453123651679781687421670
87325901875974681619759111095656

View File

@ -0,0 +1 @@
140795825305476199280233019817945689100643760412642009218490674068242032885278427377265520

View File

@ -0,0 +1,2 @@
1612303134360325403163115126153055453123651679781687421670
0

View File

@ -0,0 +1,2 @@
87598475901847598759438109874591843275923875493817439085728
298437928374982371598375498275192834579204187239084721390847293875498751908237491287349875923485

View File

@ -0,0 +1 @@
26142707676953212987620037484595819537530927510175652292771194988691770152906902796401039019311293198642505699704116000272347333325497182960052818083522080

View File

@ -0,0 +1,2 @@
59837549827514646484846292834579204187239084721390847293875498751908237491287349875923485
4236457456216386213857921746189264982365923612436823765023876109274091624865

View File

@ -0,0 +1 @@
253499234128493958903641901083610612560915799119395223324551028991082209611772242406659851469816572287755335937238553052013586988763671218944971611631489146063454525

View File

@ -0,0 +1,2 @@
10000000000100000000000000100000000000001000000000000001000000
10000000000000000000000000000000000000000000000000001

View File

@ -0,0 +1 @@
100000000001000000000000001000000000000010000000000010010000000100000000000000100000000000001000000000000001000000

View File

@ -0,0 +1,2 @@
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

View File

@ -0,0 +1 @@
1234567901234567901234567901234567901234567901234567901234567901234567901234567901234567901234567900987654320987654320987654320987654320987654320987654320987654320987654320987654320987654320987654321

View File

@ -0,0 +1,21 @@
program yubikili;
var
i,lm,k,n,x:longint;
m:ansistring;
a,c:array[1..100000] of longint;
begin
readln(n);
readln(m);
lm:=length(m);
for i:=1 to lm do a[i]:=ord(m[i])-ord('0');
x:=0;
for i:=1 to lm do
begin
c[i]:=(x*10+a[i]) div n;
x:=(x*10+a[i]) mod n;
end;
if x=0 then writeln(n) else writeln(x);
end.

View File

@ -0,0 +1,19 @@
var a:array[1..10000] of longint;
x,b:longint; n1,n2:ansistring;
lena:longint; code,i,j:longint;
begin
assign(input,'yubikili.in'); assign(output,'yubikili.out');
reset(input); rewrite(output);
readln(n1);
readln(n2);
if (n2<=n1)and(length(n2)<length(n1)) then begin writeln(n2); close(input); close(output); halt; end;
lena:=length(n2);
for i:=1 to lena do a[i]:=ord(n2[i])-ord('0');
val(n1,b,code);
x:=0;
for i:=1 to lena do x:=(x*10+a[i]) mod b;
if x=0 then writeln(n1)
else
writeln(x);
close(input); close(output);
end.

View File

@ -0,0 +1,16 @@
@echo off
if "%1"=="" goto loop
echo TEST
echo Test%1
copy yubikili%1.in yubikili.in >nul
time <enter
yubikili
time <enter
fc yubikili%1.out yubikili.out
pause
del yubikili.in
del yubikili.out
goto end
:loop
for %%i in (1 2 3 4 5) do call %0 %%i
:end

View File

@ -0,0 +1,2 @@
100000000
100000000

View File

@ -0,0 +1,2 @@
2
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

View File

@ -0,0 +1,2 @@
99999998
999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

View File

@ -0,0 +1,2 @@
78473894
8832642155044461583633521151059046808380316819087922379199216144844110044475286140264269480045782367488340711385240603755560939835449389707668393596666480539349109912048952407927989145796526660075388287655767729367758137928804351855885380612250804521010640230030418229812131164123374405932678978283787530097871142365255501388028475919498849058576972886072525825813503267718742788775281292481653779061581598551804801133220045042902022990853255810018261540212631194061936354464303529020438340782931310944202250699768949283822881610851252447956198072207623233351880835374018432914309747383494561340381382855505119144758342284895771684516810235299056643006506285537174406899939854605247954380949404660

Some files were not shown because too many files have changed in this diff Show More