Hệ sinh thái số IELP
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.

Hệ sinh thái số IELP

Học lập trình với Hệ sinh thái số IELP
 
Trang ChínhTrang Chính  CalendarCalendar  Latest imagesLatest images  Trợ giúpTrợ giúp  Tìm kiếmTìm kiếm  Thành viênThành viên  NhómNhóm  Đăng kýĐăng ký  Đăng NhậpĐăng Nhập  
Tìm kiếm
 
 

Display results as :
 
Rechercher Advanced Search
Keywords
Phần hình sinh nhật Phạm 2022 tích điểm thưởng Nhàn đặng tổng sach HOAI giác Thành Minh chứa nguyễn pháp Hoàng BANG phương Trần được wavio
Latest topics
» Buổi học số 1. Cấu trúc tuần tự trong C++ (Bài 1 -> Bài 15)
Nguyễn Trung Hiếu EmptyThu Apr 25, 2024 10:49 am by quanle1120

» Chấm bài trực tuyến với Jusolan.ddns.net
Nguyễn Trung Hiếu EmptyWed Apr 24, 2024 9:15 pm by Admin

» Bài kiểm tra giữa Học kỳ II
Nguyễn Trung Hiếu EmptyWed Apr 05, 2023 8:00 am by Nguyễn Đức Mạnh

» Bài giữa kì 2
Nguyễn Trung Hiếu EmptyMon Apr 03, 2023 8:34 am by Khách viếng thăm

» Bài giữa kì tin Lê Đức Anh
Nguyễn Trung Hiếu EmptySun Apr 02, 2023 8:33 pm by Tendalda06

» Nghiêm Tuấn Tú
Nguyễn Trung Hiếu EmptySat Apr 01, 2023 9:03 am by Nghiêm Tuấn Tú

» Nguyễn Trần Ý Nhi
Nguyễn Trung Hiếu EmptySat Apr 01, 2023 8:23 am by Nguyễn Trần Ý Nhi

» Nguyễn Kim Anh
Nguyễn Trung Hiếu EmptySat Apr 01, 2023 12:05 am by Khách viếng thăm

» Trần Thanh Trà
Nguyễn Trung Hiếu EmptyFri Mar 31, 2023 11:10 pm by Trần Thanh Trà

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendarCalendar
Top posting users this week
No user

 

 Nguyễn Trung Hiếu

Go down 
2 posters
Chuyển đến trang : 1, 2  Next
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

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyThu Jun 23, 2022 8:02 pm

Nơi nộp bài của Nguyễn Trung Hiếu
Về Đầu Trang Go down
https://ielp.forumvi.com
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:14 pm

Code:

var    n,t:int64;
begin
assign(input,'ncount.inp');reset(input);
readln(n);
close(input);
assign(output,'ncount.out');rewrite(output);
while n>0 do
begin
t:=t+ n mod 10;
n:=n div 10;
end;
write(t);
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:15 pm

Code:
var    n,t,i,s:longint;
begin
assign(input,'dcount.inp');reset(input);
read(n);
close(input);
assign(output,'dcount.out');rewrite(output);
for i:=1 to n do
begin
t:=i;
while t>0 do
begin
s:=s+1;
t:=t div 10;
end;
end;
write(s);
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:15 pm

Code:
var    n,t:longint;
begin
assign(input,'xchange.inp');reset(input);
readln(n);
close(input);
assign(output,'xchange.out');rewrite(output);
t:=n div 50;
n:=n mod 50;
t:=t+n div 20;
n:=n mod 20;
t:=t+n div 10;
n:=n mod 10;
if n=0 then write(t) else write(-1);
close(output);
end.

Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:15 pm

Code:
var    n,t,s:int64;
begin
assign(input,'xmax.inp');reset(input);
read(n);
close(input);
assign(output,'xmax.out');rewrite(output);
while n>0 do
begin
t:=n mod 10;
if s<t then s:=t;
n:=n div 10;
end;
write(s);
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:16 pm

Code:
var    n,t,i:longint;
begin
assign(input,'sdiv.inp');reset(input);
read(n);
close(input);
assign(output,'sdiv.out');rewrite(output);
for i:=1 to trunc(sqrt(n)) do
if (n mod i = 0) then
if (n div i = i) then t:=t+i else t:=t+i+ n div i;
write(t);
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:16 pm

Code:
var    i,a,x:longint;
        s:int64;
function mu(u,v:longint):int64;
var    temp:int64;
begin
if (v=0) then exit(1) else
if (v=1) then exit(u) else
begin
temp:= mu(u,v div 2);
temp:=temp*temp*mu(u,v mod 2);
temp:=temp mod 1000000007;
exit(temp);
end;
end;
begin
assign(input,'amux.inp');reset(input);
read(a,x);
close(input);
assign(output,'amux.out');rewrite(output);
s:=mu(a,x);
write(s);
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:16 pm

Code:
var    n:int64;
        s:real;
begin
assign(input,'squa.inp');reset(input);
read(n);
close(input);
assign(output,'squa.out');rewrite(output);
s:=exp(ln(n)*(1/3));
write(s:0:3);
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:17 pm

Code:
var    n,i,t:longint;
begin
assign(input,'ckprime.inp');reset(input);
read(n);
close(input);
assign(output,'ckprime.out');rewrite(output);
for i:=2 to trunc(sqrt(n)) do
if (n mod i = 0) then t:=1;
if t=1 then write('false') else write('true');
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:17 pm

Code:
var    n,i,d,j:longint;
        t,x:array [0..10000] of longint;
begin
assign(input,'fprime.inp');reset(input);
readln(n);
close(input);
assign(output,'fprime.out');rewrite(output);
t[1]:=1;t[2]:=1;d:=2;
while t[d]<n do
begin
d:=d+1;
t[d]:=t[d-1]+t[d-2];
end;
d:=d-1;
for i:=1 to t[d] do x[i]:=1;i:=2;x[1]:=0;
while (i<=trunc(sqrt(t[d]))) do if x[i]=1 then
begin
j:=2;
while (i*j<=t[d]) do
begin
x[i*j]:=0;
j:=j+1;
end;
i:=i+1;
end else i:=i+1;
j:=0;
for i:=1 to d do if x[t[i]]=1 then j:=j+1;
write(j);

close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:17 pm

Code:
var    n,i,j:longint;
        x:array [0..10000] of longint;
begin
assign(input,'eratos.inp');reset(input);
readln(n);
close(input);
assign(output,'eratos.out');rewrite(output);
for i:=1 to n do x[i]:=1;i:=2;x[1]:=0;
while i<=trunc(sqrt(n)) do if x[i]=1 then
begin
j:=2;
while i*j<=n do
begin
x[i*j]:=0;
j:=j+1;
end;
i:=i+1;
end else i:=i+1;
for i:=1 to n do if x[i]=1 then write(i,' ');
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:18 pm

Code:
var    n:longint;
procedure tsnt(u:longint);
var    i:longint;
begin
i:=2;
while i*i<=u do
begin
if (u mod i = 0) then
begin
write(i,' ');u:=u div i;
end
else i:=i+1;
end;
if u>1 then write(u);
end;

begin
assign(input,'tsnt.inp');reset(input);
read(n);
close(input);
assign(output,'tsnt.out');rewrite(output);
tsnt(n);
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:18 pm

Code:
var    i,j,t,v,d,n:longint;
        x:array [0..10000] of longint;
procedure tsnt(u:longint);
var    i:longint;
begin
i:=2;
while i*i<=u do
begin
if (u mod i = 0) then
begin
v:=v+1;x[v]:=i;u:=u div i;
end
else i:=i+1;
end;
if u>1 then x[v+1]:=u;
end;

begin
assign(input,'nfind.inp');reset(input);
read(n);
close(input);
assign(output,'nfind.out');rewrite(output);
tsnt(n);
if x[v+1]>=10 then write(-1) else
begin
for i:=v+1 downto 2 do if (x[i]<>0) and (x[i]*x[i-1]<10) then
begin
x[i]:=x[i-1]*x[i];
x[i-1]:=0;
end;
for i:=1 to v do
for j:=i+1 to v+1 do if x[i]>x[j] then
begin
t:=x[i];x[i]:=x[j];x[j]:=t;
end;
for i:=1 to v+1 do if x[i]<>0 then write(x[i]);
end;
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:18 pm

Code:
uses math;
var    o,i,n,m,res,t:longint;
function nt(u:longint):boolean;
var    i:longint;
begin
if u<2 then exit(false);
if u<4 then exit(true);
for i:=2 to trunc(sqrt(u)) do
if (u mod i = 0) then exit(false);
exit(true);
end;
begin
assign(input,'numberc.inp');reset(input);
read(n);
close(input);
assign(output,'numberc.out');rewrite(output);
n:=n div 10;
while (nt(n)=false) and (n>0) do
n:=n div 10;
if n>0 then write(n) else write(-1);
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:19 pm

Code:
uses math;
var    n,i:longint;
        a:array [0..100000] of longint;
begin
assign(input,'arrdel.inp');reset(input);
readln(n);
for i:=1 to n do read(a[i]);
close(input);
assign(output,'arrdel.out');rewrite(output);
for i:=1 to n do if a[i]<>a[i-1] then write(a[i],' ');
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:20 pm

Code:
var    n,o:longint;
        a:array [0..1000000] of longint;
Procedure qsort(L, H:longint);
Var i,j,mid, temp:longint;
Begin
 If (L>H) then exit();
 I:=L;
 J:=H;
 Mid:=a[(i+j) div 2];
 While i<=j do
 Begin
 While a[i]<mid do inc(i);
 While a[j]>mid do dec(j);
 If i<=j then
 Begin
 Temp:=a[i];
 A[i]:=a[j];
 A[j]:=temp;
 Inc(i); dec(j);
 End;

 End;
 If L < j then qsort(L,j);
 If i < H then qsort(i,H);
End;

begin
assign(input,'qsort.inp');reset(input);
readln(n);
for o:=1 to n do read(a[o]);
close(input);
assign(output,'qsort.out');rewrite(output);
qsort(1,n);
for o:=1 to n do write(a[o],' ');
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:20 pm

Code:
var    n,i,t:longint;
        a,fx:array [0..1000000] of longint;
begin
assign(input,'ilucky.inp');reset(input);
readln(n);
for i:=1 to n do read(a[i]);
close(input);
assign(output,'ilucky.out');rewrite(output);
for i:=1 to n do fx[i]:=fx[i-1]+a[i];
for i:=1 to n-1 do if (fx[i]=fx[n]-fx[i]) then
begin
write(i,' ');
t:=-1;
end;
if t=0 then write(-1);
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:20 pm

Code:
uses math;
var    n,i,res:longint;
        a:array [0..1000000] of longint;
begin
assign(input,'pmin.inp');reset(input);
readln(n);
for i:=1 to n do read(a[i]);
close(input);
assign(output,'pmin.out');rewrite(output);
res:=high(longint);
for i:=1 to n do res:=min(res,a[i]);
for i:=1 to n do if a[i]=res then write(i,' ');
close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyFri Jun 24, 2022 8:21 pm

Code:
var    n,i,o:longint;
        a,b:array [0..1000000] of longint;
Procedure qsort(L, H:longint);
Var i,j,mid, temp:longint;
Begin
 If (L>H) then exit();
 I:=L;
 J:=H;
 Mid:=a[(i+j) div 2];
 While i<=j do
 Begin
 While a[i]<mid do inc(i);
 While a[j]>mid do dec(j);
 If i<=j then
 Begin
 Temp:=a[i];
 A[i]:=a[j];
 A[j]:=temp;
 Inc(i); dec(j);
 End;

 End;
 If L < j then qsort(L,j);
 If i < H then qsort(i,H);
End;
begin
assign(input,'psecond.inp');reset(input);
readln(n);
for i:=1 to n do read(a[i]);
close(input);
assign(output,'psecond.out');rewrite(output);
for i:=1 to n do b[i]:=a[i];
qsort(1,n);i:=2;
while (a[1]=a[i]) and (i<=n) do i:=i+1;
if i=n+1 then write(-1) else for o:=1 to n do if b[o]=a[i] then write(o,' ');
close(output);
end.


Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyMon Aug 22, 2022 8:15 pm

Code:
var    n,k:longint;
        x:array [0..100000] of longint;
procedure xuli;
var    i:longint;
begin
        for i:=1 to k do write(x[i],' ');
        writeln();
end;
procedure thu(u:longint);
var    v:longint;
begin
        for v:=x[u-1]+1 to n-k+u do
        begin
                x[u]:=v;
                if u<k then thu(u+1) else xuli;
        end;
end;
begin
        assign(input,'dqckn1.inp');reset(input);
        read(n,k);
        close(input);
        assign(output,'dqckn1.out');rewrite(output);
        thu(1);
        close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyMon Aug 22, 2022 8:38 pm

Code:
var    n,k,s,i:longint;
        x,a:array [0..100000] of longint;
procedure xuli;
var    i,t:longint;
begin
        t:=0;
        for i:=1 to k do t:=t+a[x[i]];
        if (t=s) then
        begin
                for i:=1 to k do write(a[x[i]],' ');
                writeln();
        end;
end;
procedure thu(u:longint);
var    v:longint;
begin
        for v:=x[u-1]+1 to n-k+u do
        begin
                x[u]:=v;
                if u<k then thu(u+1) else xuli;
        end;
end;
begin
        assign(input,'dqckn2.inp');reset(input);
        readln(n,s,k);
        for i:=1 to n do read(a[i]);
        close(input);
        assign(output,'dqckn2.out');rewrite(output);
        thu(1);
        close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyMon Aug 22, 2022 8:54 pm

Code:
var    n,k,i:longint;
        x,a:array [0..100000] of longint;
function nt(u:longint):boolean;
var    v:longint;
begin
        u:=abs(u);
        if (u=1) then exit(false);
        if (u=2) or (u=3) then exit(true);
        for v:=2 to trunc(sqrt(u)) do
        if (u mod v = 0) then exit(false);
        exit(true);
end;
procedure xuli;
var    i,t:longint;
begin
        t:=0;
        for i:=1 to k do t:=t+a[x[i]];
        if nt(t) then
        begin
                for i:=1 to k do write(a[x[i]],' ');
                writeln();
        end;
end;
procedure thu(u:longint);
var    v,p:longint;
begin
        for v:=x[u-1]+1 to n-k+u do
        begin
                x[u]:=v;
                if u<k then thu(u+1) else xuli;
        end;
end;
begin
        assign(input,'dqckn3.inp');reset(input);
        readln(n,k);
        for i:=1 to n do read(a[i]);
        close(input);
        assign(output,'dqckn3.out');rewrite(output);
        thu(1);
        close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyMon Aug 22, 2022 9:00 pm

Code:
uses math;
var    n,k,i,res:longint;
        x,a:array [0..100000] of longint;
function dx(u:longint):boolean;
var    v,v1,t:longint;
begin
        v:=0;v1:=u;
        while (u>0) do
        begin
                t:=u mod 10;
                v:=v*10 + t;
                u:=u div 10;
        end;
        if (v1=v) then exit(true) else exit(false);
end;
procedure xuli;
var    i,t:longint;
begin
        t:=0;
        for i:=1 to k do t:=t+a[x[i]];
        if dx(t) then res:=max(res,t);
end;
procedure thu(u:longint);
var    v,p:longint;
begin
        for v:=x[u-1]+1 to n-k+u do
        begin
                x[u]:=v;
                if u<k then thu(u+1) else xuli;
        end;
end;
begin
        assign(input,'dqckn4.inp');reset(input);
        readln(n,k);
        for i:=1 to n do read(a[i]);
        close(input);
        assign(output,'dqckn4.out');rewrite(output);
        thu(1);
        write(res);
        close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyMon Aug 22, 2022 9:13 pm

Code:
uses math;
var    n,k,i,res,mi,ma:longint;
        x,a:array [0..100000] of longint;
function kt:boolean;
var    v,v1,v2,t:longint;
begin
        v1:=0;v2:=0;
        for i:=1 to k do
        begin
                if a[x[i]]=ma then v1:=1;
                if a[x[i]]=mi then v2:=1;
        end;
        v:=v1+v2;
        if v=2 then exit(true) else exit(false);
end;
procedure xuli;
var    i,t:longint;
begin
        if kt then
        begin
                for i:=1 to k do write(a[x[i]],' ');
                writeln();
        end;
end;
procedure thu(u:longint);
var    v,p:longint;
begin
        for v:=x[u-1]+1 to n-k+u do
        begin
                x[u]:=v;
                if u<k then thu(u+1) else xuli;
        end;
end;
begin
        assign(input,'dqckn51.inp');reset(input);
        readln(n,k);
        for i:=1 to n do read(a[i]);
        close(input);
        assign(output,'dqckn51.out');rewrite(output);
        ma:=a[1];mi:=a[1];
        for i:=1 to n do
        begin
                ma:=max(ma,a[i]);
                mi:=min(mi,a[i]);
        end;
        thu(1);
        close(output);
end.
Về Đầu Trang Go down
lyo2850




Tổng số bài gửi : 47
Join date : 08/06/2022

Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu EmptyMon Aug 29, 2022 9:12 pm

Code:
uses math;
var    a,b,x,kt:array [0..100000] of longint;
        res,n,k,m,i,j:longint;
procedure xuli;
var    i,t:longint;
begin
        t:=0;
        for i:=1 to k do t:=t+a[x[i]];
        if t>m then exit();
        t:=0;
        for i:=1 to k do t:=t+b[x[i]];
        res:=max(res,t);
end;
procedure thu(u:longint);
var    v:longint;
begin
        for v:=x[u-1]+1 to n-k+u do
        begin
                x[u]:=v;
                if u=k then xuli else thu(u+1);
        end;

end;
begin
        assign(input,'dqckn6.inp');reset(input);
        readln(n,k,m);
        for i:=1 to n do read(a[i]);
        for i:=1 to n do read(b[i]);
        close(input);
        assign(output,'dqckn6.out');rewrite(output);
        thu(1);
        write(res);
        close(output);
end.
Về Đầu Trang Go down
Sponsored content





Nguyễn Trung Hiếu Empty
Bài gửiTiêu đề: Re: Nguyễn Trung Hiếu   Nguyễn Trung Hiếu Empty

Về Đầu Trang Go down
 
Nguyễn Trung Hiếu
Về Đầu Trang 
Trang 1 trong tổng số 2 trangChuyển đến trang : 1, 2  Next
 Similar topics
-
» Nguyễn Trung Hiếu
» Nguyễn Trung Hiếu
» Bui Trung Hieu
» Vũ Quang Trung
» Nguyễn Trung Dũng

Permissions in this forum:Bạn không có quyền trả lời bài viết
Hệ sinh thái số IELP :: Thực nghiệm phần C++ :: 3-Lập trình cơ bản 2-
Chuyển đến