Trường ĐH Bách Khoa Hà Nội |
Thuật toán ứng dụng 0460183554HuyNQ | Logout
=> Hướng dẫn
HOME TOP CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP
PROBLEMS SUBMIT CODE MY SUBMISSIONS STATUS STANDINGS CUSTOM INVOCATION
ĐH Bách Khoa Hà Nội
A. CHANGE Private
time limit per test: 1 second
Participant
memory limit per test: 256 megabytes
input: standard input
output: standard output
Minh go shopping at the SS shop. The shop has currency denominations: 1$, 5$, 10$, 50$, → About Group
100$, 500$. Minh takes some items at the shop and pay an amount of 1000$. Your task to
devise a method to pay back amount to customer using fewest number of money notes.
Input
The input consists of only one single integer N (1 ≤ N ≤ 999 ) denoting the total value of
the taken items.
Output
The output consists of only one single integer denoting the number of money notes.
Examples
input Copy
output Copy
15
input Copy
Trang nộp bài trực tuyến dành cho sinh viên
3 tham gia môn học "Thuật toán ứng dụng" của
Viện CNTT-TT, Đại học BKHN
output Copy
13 Group website
Training 7 - Greedy - 20201
Contest is running
5 months
Contestant
→ About Time Scaling
This contest uses time limits scaling policy
(depending on a programming language).
The system automatically adjusts time limits
by the following multipliers for some
languages. Despite scaling (adjustment), the
time limit cannot be more than 30 seconds.
Read the details by the link.
→ Submit?
Language: GNU G++17 7.3.0
Choose
file: Choose File No file chosen
Submit
→ Your points
Points
B
C
Codeforces (c) Copyright 2010-2021 Mike Mirzayanov
The only programming contests Web 2.0 platform
Server time: Jan/11/2021 20:25:13UTC+7 (f3).
Desktop version, switch to mobile version.
Privacy Policy
Supported by
Trường ĐH Bách Khoa Hà Nội |
Thuật toán ứng dụng 0460183554HuyNQ | Logout
=> Hướng dẫn
HOME TOP CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP
PROBLEMS SUBMIT CODE MY SUBMISSIONS STATUS STANDINGS CUSTOM INVOCATION
ĐH Bách Khoa Hà Nội
B. Planting Trees Private
time limit per test: 1 second
Participant
memory limit per test: 256 megabytes
input: standard input
output: standard output
Farmer Jon has recently bought n tree seedlings that he wants to plant in his yard. It takes 1 → About Group
day for Jon to plant a seedling: {Jon isn't particularly hardworking.}, and for each tree Jon
knows exactly in how many days after planting it grows to full maturity. Jon would also like to
throw a party for his farmer friends, but in order to impress them he would like to organize the
party only after all the trees have grown. More precisely, the party can be organized at earliest
on the next day after the last tree has grown up.
Help Jon to find out when is the earliest day when the party can take place. Jon can choose
the order of planting the trees as he likes, so he wants to plant the trees in such a way that the
party will be as soon as possible.
Input
The input consists of two lines. The first line contains a single integer N (
1 ≤ N ≤ 100 000 ) denoting the number of seedlings. Then a line with N integers t i
follows (1 ≤ ti ≤ 1 000 000 ), where ti denotes the number of days it takes for the ith tree
to grow.
Output
You program should output exactly one line containing one integer, denoting the earliest day
when the party can be organized. The days are numbered 1, 2, 3, … beginning from the
Trang nộp bài trực tuyến dành cho sinh viên
current moment. tham gia môn học "Thuật toán ứng dụng" của
Viện CNTT-TT, Đại học BKHN
Example
Group website
input Copy
1
1 Training 7 - Greedy - 20201
output Copy Contest is running
3
5 months
Contestant
→ About Time Scaling
This contest uses time limits scaling policy
(depending on a programming language).
The system automatically adjusts time limits
by the following multipliers for some
languages. Despite scaling (adjustment), the
time limit cannot be more than 30 seconds.
Read the details by the link.
→ Submit?
Language: GNU G++17 7.3.0
Choose
file: Choose File No file chosen
Submit
→ Your points
Points
B
C
Codeforces (c) Copyright 2010-2021 Mike Mirzayanov
The only programming contests Web 2.0 platform
Server time: Jan/11/2021 20:27:09UTC+7 (f3).
Desktop version, switch to mobile version.
Privacy Policy
Supported by
Trường ĐH Bách Khoa Hà Nội |
Thuật toán ứng dụng 0460183554HuyNQ | Logout
=> Hướng dẫn
HOME TOP CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP
PROBLEMS SUBMIT CODE MY SUBMISSIONS STATUS STANDINGS CUSTOM INVOCATION
ĐH Bách Khoa Hà Nội
C. ATM Private
time limit per test: 1 second
Participant
memory limit per test: 256 megabytes
input: standard input
output: standard output
Vinh works for an ATM machine manufacturing company. The basic functionality of an ATM → About Group
machine is cash withdrawal. When a user requests a cash withdrawal of W VND (Vietnamese
Dong), the ATM has to dispense N money notes such that they sum up to W . For the next
generation of ATM machines, Vinh is working on an algorithm to minimize the number of N of
money notes for each cash withdrawal transaction.
Your task is to help Vinh to do his job given that the money notes come in the values of
1 1 1 1 c c c c
1000, 2000, 3000, 5000, 1000 ⋅ 10 , 2000 ⋅ 10 , 3000 ⋅ 10 , 5000 ⋅ 10 , … , 1000 ⋅ 10 , 2000 ⋅ 10 , 3000 ⋅ 10 , 5000 ⋅ 10
where c is a positive integer and Vinh has unlimited supply of money notes for each value.
Input
The input file consists of several datasets. The first line of the input file contains the number of
datasets which is a positive integer and is not greater than 1000. The following lines describe
the datasets.
18
The first line consists of one positive integer W (W ≤ 10 );
The second line consists of one positive integer c (c ≤ 15 ).
Output
Trang nộp bài trực tuyến dành cho sinh viên
For each dataset, write in one line two space-separated integers N and S where S is the tham gia môn học "Thuật toán ứng dụng" của
number of ways to dispense the fewest number N of money notes. In case there is no way to Viện CNTT-TT, Đại học BKHN
serve the cash withdrawal request, write out 0 in one line instead.
Group website
Example
input Copy
Training 7 - Greedy - 20201
2
1000 Contest is running
1
7000 5 months
1
Contestant
output Copy
1 1
2 1
→ About Time Scaling
This contest uses time limits scaling policy
(depending on a programming language).
The system automatically adjusts time limits
by the following multipliers for some
languages. Despite scaling (adjustment), the
time limit cannot be more than 30 seconds.
Read the details by the link.
→ Submit?
Language: GNU G++17 7.3.0
Choose
file: Choose File No file chosen
Submit
→ Your points
Points
B
C
Codeforces (c) Copyright 2010-2021 Mike Mirzayanov
The only programming contests Web 2.0 platform
Server time: Jan/11/2021 20:27:32UTC+7 (f3).
Desktop version, switch to mobile version.
Privacy Policy
Supported by
Trường ĐH Bách Khoa Hà Nội |
Thuật toán ứng dụng 0460183554HuyNQ | Logout
=> Hướng dẫn
HOME TOP CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP
PROBLEMS SUBMIT CODE MY SUBMISSIONS STATUS STANDINGS CUSTOM INVOCATION
ĐH Bách Khoa Hà Nội
F. 02. POSTMAN Private
time limit per test: 1 second
Participant
memory limit per test: 256 megabytes
input: standard input
output: standard output
Chuyển phát hàng là một công việc quan trọng trong thương mại điện tử là lĩnh vực phát triển → About Group
bùng nổ trong thời gian hiện nay. Ta xét công việc của một nhân viên giao hàng của Công ty
XYZ chuyên bán hàng trên mạng. Nhân viên giao hàng cần phát các kiện hàng (được đóng
gói trong các hộp cùng kích thước) đến các khách hàng có địa chỉ trên một đại lộ có dạng một
đường thẳng.
Nhân viên giao hàng sẽ nhận các kiện hàng tại trụ sở công ty ở vị trí x = 0, và cần chuyển
phát hàng đến n khách hàng, được đánh số từ 1 đến n. Biết x i và mi là vị trí của khách
hàng i và số lượng kiện hàng cần chuyển cho khách hàng này. Do các kiện hàng là khá cồng
kềnh nên mỗi lần đi chuyển phát nhân viên giao hàng chỉ có thể mang theo không quá k kiện
hàng.
Nhân viên giao hàng xuất phát từ trụ sở, nhận một số (không quá k ) kiện hàng và di chuyển
theo đại lộ để chuyển phát cho một số khách hàng. Khi giao hết các kiện hàng mang theo,
nhân viên giao hàng lại quay trở về trụ sở và lặp lại công việc nói trên cho đến khi chuyển
phát được tất cả các kiện hàng cho khách hàng. Sau khi kết thúc công việc chuyển phát, nhân
viên phải quay trở lại trụ sở công ty để nộp cho phòng kế toán tất cả các hóa đơn giao nhận
có ký nhận của khách hàng. Giả thiết là: tốc độ di chuyển của nhân viên là 1 đơn vị khoảng
cách trên một đơn vị thời gian. Thời gian nhận hàng ở trụ sở công ty và thời gian bàn giao
hàng cho khách hàng được coi là bằng 0.
Trang nộp bài trực tuyến dành cho sinh viên
tham gia môn học "Thuật toán ứng dụng" của
Yêu cầu: Giả sử thời điểm mà nhân viên giao hàng bắt đầu công việc là 0. Hãy giúp nhân viên Viện CNTT-TT, Đại học BKHN
giao hàng tìm cách hoàn thành công việc đã mô tả ở trên tại thời điểm sớm nhất.
Group website
Input
Dòng đầu tiên chứa hai số nguyên dương được ghi cách nhau bởi dấu cách n và k
(n ≤ 1000; k ≤ 10 ) .
7 Training 7 - Greedy - 20201
Contest is running
Dòng thứ i trong số n dòng tiếp theo chứa hai số nguyên được ghi cách nhau bởi dấu cách
x i (|xi| ≤ 10 )
7
và mi (1 ≤ mi ≤ 10 )
7 5 months
Contestant
Output
Ghi ra một số nguyên là thời điểm sớm nhất mà người giao hàng có thể hoàn thành nhiệm vụ
của mình.
Examples → About Time Scaling
input Copy
This contest uses time limits scaling policy
7 1 (depending on a programming language).
9400000 10000000 The system automatically adjusts time limits
9500000 10000000 by the following multipliers for some
9600000 10000000 languages. Despite scaling (adjustment), the
time limit cannot be more than 30 seconds.
9700000 10000000 Read the details by the link.
9800000 10000000
9900000 10000000
10000000 10000000
output Copy → Submit?
1358000000000000
Language: GNU G++17 7.3.0
input Copy Choose
4 10 file: Choose File No file chosen
-7 5
-2 3 Submit
5 7
9 5
output Copy → Your points
42 Points
B
C
Codeforces (c) Copyright 2010-2021 Mike Mirzayanov
The only programming contests Web 2.0 platform
Server time: Jan/11/2021 20:27:42UTC+7 (f3).
Desktop version, switch to mobile version.
Privacy Policy
Supported by