May 2024 | Mon | Tue | Wed | Thu | Fri | Sat | Sun |
---|
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | | | Calendar |
|
Top posting users this week | |
| | Sạch Thùy Trâm | |
| | Tác giả | Thông điệp |
---|
Admin Admin
Tổng số bài gửi : 152 Join date : 23/04/2022 Age : 41 Đến từ : THPT Chuyên Nguyễn Tất Thành - Yên Bái
| Tiêu đề: Sạch Thùy Trâm Mon Sep 12, 2022 9:42 pm | |
| | |
| | | Sạch Thuỳ Trâm Khách viếng thăm
| Tiêu đề: Bài 11:ARR2HVS1 Wed Sep 14, 2022 3:13 pm | |
| program ct; uses math; var m,n,s:longint; A,ss:array [-5..300,-5..300] of longint; procedure doc; var i,j:longint; begin assign(input,'ARR2HVS1.inp'); assign(output,'ARR2HVS1.out'); reset(input); rewrite(output); readln(m,n,s); for i:=1 to m do for j:=1 to n do read(a[i,j]); end; function tong(x,x1,y,y1:longint):longint; var xy,yx:longint; s1:int64; begin s1:=0; for xy:=x to x1 do for yx:=y to y1 do s1:=s1+A[xy,yx]; exit(s1); end; procedure xl; var i,p,k,x1,y1,tam,vc:longint; begin p:=0; tam:=0; if m<n then vc:=m else vc:=n; for k:=1 to vc do begin tam:=0; for x1:=1 to m do for y1:=1 to n do begin tam:=tong(x1,x1+k-1,y1,y1+k-1); if tam=s then begin writeln(x1,#32,y1,#32,k); p:=1; end; end; end; if p=0 then write('-1'); end; begin doc; xl; close(input); close(output); end. |
| | | Tr Âm Khách viếng thăm
| Tiêu đề: Bài 1:SDIV Wed Sep 14, 2022 3:22 pm | |
| uses math; var n,i:longint; const fi='SDIV.INP'; fo='SDIV.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); readln(n); close(input); end; function UOC(u:longint):int64; var res:int64=0; begin for i:=1 to trunc(sqrt(u)) do if u mod i=0 then begin res:=res+i; if i<> u div i then res:=res+u div i; end; exit(res); end; begin nhap; write(UOC(n)); close(output); end. |
| | | vũ văn xuânn
Tổng số bài gửi : 8 Join date : 13/09/2022
| Tiêu đề: Re: Sạch Thùy Trâm Wed Sep 14, 2022 3:48 pm | |
| uses math; var A,s : array [-1..300,-1..300] of longint; ii,jj,res,i,n,m,j,p,x : longint; t,dt : int64; const fi = 'ARR2REC1.inp'; fo = 'ARR2REC1.out'; procedure doc; begin assign(input,fi); reset(input); assign(output,fo); rewrite(output); readln(m,n); for i := 1 to m do for j := 1 to n do begin read(a[i,j]); s[i,j] := s[i-1,j] + s[i,j-1] - s[i-1,j-1] + a[i,j]; end; end; begin doc; p := 0; res := -trunc(1e9); for i := 1 to m do for j := 1 to n do for ii := i to m do for jj := j to n do begin t := s[ii,jj] - s[i-1,jj] - s[ii,j-1] + s[i-1,j-1]; dt := (ii-i+1)*(jj-j+1); if t = dt then begin res := max(res,dt); p := 1; end; end; if p = 0 then write(-1); write(res); close(input); close(output); end. | |
| | | Tr Âm Khách viếng thăm
| Tiêu đề: Bài 2:LASTNUM Wed Sep 14, 2022 8:31 pm | |
| uses math; var i,n,a:longint; p:int64=0; const fi='LASTNUM.INP'; fo='LASTNUM.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); read(a,N); close(input); end; procedure xl; begin p:=1; for i:=1 to n do p:=(p*a) mod 10; write(p); end; begin nhap; xl; close(output); end. |
| | | Tr Âm Khách viếng thăm
| Tiêu đề: Bài 3:NUMBERC Wed Sep 14, 2022 8:43 pm | |
| uses math; var n:int64; procedure nhap; begin assign(input,'NUMBERC.INP');reset(input); assign(output,'NUMBERC.OUT');rewrite(output); readln(n) end; function NT(u:int64):boolean; var i:longint; begin if (u<1) then exit(false); if (u=2) or (u=3) then exit(true); for i:=2 to trunc(sqrt(u)) do if u mod i=0 then exit(false); exit(true); end; begin nhap; while n div 10>0 do begin n:=n div 10; if NT(n) then begin write(n); exit; end; end; write(-1); close(input); close(output); end. |
| | | Tr Âm Khách viếng thăm
| Tiêu đề: Bài 4:TSNT Wed Sep 14, 2022 8:46 pm | |
| uses math; var n,k,i:longint; c:array[-5..100007] of longint; const fi='TSNT.INP'; fo='TSNT.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); read(n); close(input); end; procedure phantich(u:longint); var i:longint; begin i:=2; while i*i<=u do if u mod i=0 then begin inc(k); c[k]:=i; u:=u div i; end else inc(i); if u>1 then begin inc(k); c[k]:=u; end; end; begin nhap; k:=0; phantich(n); for i:=1 to k do write(c[i],#32); close(output); end.
|
| | | Tr Âm Khách viếng thăm
| Tiêu đề: Bài 5:ARR2DPRI Wed Sep 14, 2022 9:06 pm | |
| uses math; var i,j,n,m:longint; a:array[-3..300,-3..300] of longint; const fi='ARR2DPRI.INP'; fo='ARR2DPRI.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); readln(m,n); for i:=1 to m do for j:=1 to n do read(a[i,j]); close(input); end; function NT(u:longint):boolean; var i:longint; begin if (u<2) then exit(false); if (u=2) or (u=3) then exit(true); for i:=2 to trunc(sqrt(u)) do if u mod i=0 then exit(false); exit(true); end; procedure xl; var p:longint; begin p:=0; for i:=1 to m do for j:=1 to n do begin if NT(a[i,j]) then begin p:=1; writeln(i,#32,j); end; end; if p=0 then write(-1); end; begin nhap; xl; close(output); end. |
| | | Tr Âm Khách viếng thăm
| Tiêu đề: Bài 6: ERATOS Thu Sep 15, 2022 7:39 am | |
| uses math; var n,i:longint; f:array[-5..100007] of boolean; const fi='ERATOS.INP'; fo='ERATOS.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); readln(n); close(input); end; procedure sang(u:longint); var i,k:longint; begin for i:=1 to u do f[i]:=true; f[1]:=false; for i:=2 to trunc(sqrt(u)) do if f[i] then begin k:=2; while i*k<=u do begin f[i*k]:=false; inc(k); end; end; end; begin nhap; sang(n); for i:=1 to n do if f[i] then write(i,#32); end. |
| | | Tr Âm Khách viếng thăm
| Tiêu đề: Bài 7:FPRIME Thu Sep 15, 2022 2:23 pm | |
| uses math; var p,i:longint; f:array[-5..100007] of longint; const fi='FPRIME.INP'; fo='FPRIME.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); readln(p); close(input); end; function NT(u:longint):boolean; var j:longint; begin if u<2 then exit(false); if (u=2) or (u=3) then exit(true); for j:=2 to trunc(sqrt(u)) do if u mod j=0 then exit(false); exit(true); end; procedure xl; var res:longint; begin res:=0; f[1]:=1; f[2]:=1; i:=2; while (f[i]<=p) do begin if NT(f[i]) then inc(res); inc(i); f[i]:=f[i-1]+f[i-2]; end; write(res); end; begin nhap; xl; close(output); end. |
| | | Tr Âm Khách viếng thăm
| Tiêu đề: Bài 8:PSECOND Thu Sep 15, 2022 2:50 pm | |
| uses math; var n,i,rmin,rmax:longint; a:array[-5..100007] of longint; const fi='PSECOND.INP'; fo='PSECOND.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); readln(n); rmin:=trunc(1e9); rmax:=-trunc(1e9); for i:=1 to n do begin read(a[i]); rmin:=min(rmin,a[i]); rmax:=max(rmax,a[i]); end; close(input); end; procedure xl; begin if rmin=rmax then begin write(-1); exit; end; for i:=1 to n do if (a[i]<=rmax) and (a[i]>rmin) then rmax:=a[i]; for i:=1 to n do if a[i]=rmax then write(rmax,#32,i); end; begin nhap; xl; close(output); end. |
| | | Tr Âm Khách viếng thăm
| Tiêu đề: Bài 9:TSNT Thu Sep 15, 2022 7:19 pm | |
| uses math; var n,k,i:longint; c:array[-5..100007] of longint; const fi='TSNT.INP'; fo='TSNT.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); read(n); close(input); end; procedure phantich(u:longint); var i:longint; begin i:=2; while i*i<=u do if u mod i=0 then begin inc(k); c[k]:=i; u:=u div i; end else inc(i); if u>1 then begin inc(k); c[k]:=u; end; end; begin nhap; k:=0; phantich(n); for i:=1 to k do write(c[i],#32); close(output); end. |
| | | Tr Âm Khách viếng thăm
| Tiêu đề: Bài 12:EMERALD Sun Sep 18, 2022 9:23 am | |
| uses math; var n,i,res,s:longint; a,b,d:array[-5..100007] of longint; const fi='EMERALD.INP'; fo='EMERALD.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); readln(n); s:=0; for i:=1 to n do begin read(a[i]); s:=s+a[i]; end; end; procedure xl; var s1,dem:longint; begin s1:=0; dem:=0; for i:=1 to n do if b[i]=1 then begin s1:=s1+a[i]; inc(dem); if s1*3>s then exit(); end; if s1*3=s then begin res:=dem; for i:=1 to n do d[i]:=b[i]; end; end; procedure thu(i:longint); var j:longint; begin for j:=0 to 1 do begin b[i]:=j; if i=n then xl else thu(i+1); end; end; begin nhap; res:=0; thu(1); if res=0 then write(0) else begin write(res); writeln; for i:=1 to n do if d[i]=1 then write(i,#32); end; close(input); close(output); end. |
| | | Tr Âm Khách viếng thăm
| Tiêu đề: BÀi 13:MODM Sun Sep 18, 2022 9:24 am | |
| uses math; var i,n,m,res:longint; a,b,c,d:array[-5..100007] of longint; const fi='MODM.INP'; fo='MODM.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); readln(n,m); for i:=1 to n do read(a[i]); end; procedure xl; var j,k:longint; begin k:=0; for i:=1 to n do if b[i]=1 then begin inc(k); c[k]:=a[i]; end; for i:=1 to k-1 do for j:=i+1 to k do if (c[i]+c[j]) mod m=0 then exit(); if res<k then begin res:=k; for i:=1 to n do d[i]:=b[i]; end; end; procedure thu(i:longint); var j:longint; begin for j:=0 to 1 do begin b[i]:=j; if i=n then xl else thu(i+1); end; end; begin nhap; thu(1); write(res); writeln; for i:=1 to n do if d[i]=1 then write(i,#32); close(input); close(output); end.
|
| | | Tr Âm Khách viếng thăm
| Tiêu đề: Bài 14:FINANCIAL Sun Sep 18, 2022 9:25 am | |
| uses math; var i,n,k,res:longint; a,b,c,d:array[-5..100007] of longint; const fi='FINANCIAL.INP'; fo='FINANCIAL.OUT'; procedure nhap; var i:longint; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); readln(n,k); for i:=1 to n do read(a[i]); end; procedure xl; var j,k1:longint; begin k1:=0; for i:=1 to n do if b[i]=1 then begin inc(k1); c[k1]:=a[i]; end; for i:=1 to k1-1 do if abs(c[i]-c[i+1])<k then exit(); if res<k1 then begin res:=k1; for i:=1 to k1 do d[i]:=c[i]; end; end; procedure thu(i:longint); var j:longint; begin for j:=0 to 1 do begin b[i]:=j; if i=n then xl else thu(i+1); end; end; begin nhap; res:=0;; thu(1); writeln(res); for i:=1 to res do write(d[i],#32); close(input); close(output); end. |
| | | Tr ÂM Khách viếng thăm
| Tiêu đề: Bài 15:BINARY Sun Sep 18, 2022 9:53 am | |
| uses math; var s:string; res,n:longint; b:array[0..20] of char; const fi='BINARY.INP'; fo='BINARY.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); readln(n); readln(s); end; function dem(u,v:string):longint; var t:longint; begin t:=0; while pos(u,v)>0 do begin inc(t); delete(v,1,pos(u,v)); end; exit(t); end; procedure xl; var s2:string; i:longint; begin s2:=''; for i:=1 to n do s2:=s2+b[i]; if dem(s,s2)=1 then res:=(res+1) mod 1000000007; end; procedure thu(i:longint); var j:char; begin for j:='0' to '1' do begin b[i]:=j; if i=n then xl else thu(i+1); end; end;
begin nhap; thu(1); write(res); close(input); close(output); end. |
| | | Tr Âm Khách viếng thăm
| Tiêu đề: bài 16:DQCKN1 Sun Sep 18, 2022 10:17 am | |
| uses math; var i,n,k:longint; a,b:array[-5..100007] of longint; const fi='DQCKN1.INP'; fo='DQCKN1.OUT'; procedure nhap; begin assign(input,fi);reset(input); assign(output,fo);rewrite(output); readln(n,k); close(input); end; procedure xl; var i:longint; begin for i:=1 to k do write(b[i],#32); writeln; end; procedure thu(i:longint); var j:longint; begin for j:=(b[i-1]+1) to (n-k+i) do begin b[i]:=j; if i=k then xl else thu(i+1); end; end; begin nhap; b[0]:=0; thu(1); close(output); end.
|
| | | Sponsored content
| Tiêu đề: Re: Sạch Thùy Trâm | |
| |
| | | | Sạch Thùy Trâm | |
|
Trang 1 trong tổng số 1 trang | |
Similar topics | |
|
| Permissions in this forum: | Bạn được quyền trả lời bài viết
| |
| |
| |