A. Max {arr}
Xotira: 32 MB, Vaqt: 1000 msSizga \(a\) massiv berilgan, sizning qilishingiz kerak bo'lgan ish.
Massivdagi eng katta qiymatni chiqarish
\(INPUT.TXT\) A massiv
\(OUTPUT.TXT\) Masala javobi chop eting
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
1 2 3 4 5 6 7 8 9 |
9 |
B. Search {arr}
Xotira: 32 MB, Vaqt: 1000 msSizga \(a\) massiv va \(b\) soni beriladi, sizning qilishingiz kerak bo'lgan ish
\(A\) massiv ichida \(B\) sonini topish
\(INPUT.TXT\) Birinchi qatorda - massiv
Ikkinchi qatorda - son
\(OUTPUT.TXT\) Natijani chop eting, agarda ilojisi bo'lmasa “-1” deb chiqarsin, ilojisi bo'lsa index+1 ni chop eting
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
1 2 3 4 5 6 6 |
6 |
2 |
12 3 54 6 1 |
-1 |
C. Type
Xotira: 32 MB, Vaqt: 1000 msSizga ma'lumot turlarining nomi kiritiladi.
Sizning qilishingiz kerak bo'lgan ish, nechi byte ekanligi topishingiz kerak
\(INPUT.TXT\) Sizga bir ma'lumot turi beriladi
\(OUTPUT.TXT\) Masala javobini chop eting
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
int |
4 |
2 |
bool |
1 |
D. Qidiruv
Xotira: 32 MB, Vaqt: 1000 msAsadbek matematika darsiga quloq solmaganligi uchun, uning ustozi bir jazo o'ylab topdi.
Jazo quyidagicha edi:
Sizga \(N\) ta sondan iborat massiv beriladi, ular \(A\) dan \(B\) gacha bo'lgan sonlardan iborat bo'ladi va ulardan birini ustozi boshqa son bilan o'zgartirib qo'ydi
Asadbekga yordam bering!
\(INPUT.TXT\)
1-qatorda N soni, A va B sonlari
2-qatorda N+1 ta sondan iborat massiv kiritiladi
\(OUTPUT.TXT\) Masala javobini chop eting, agarda N soni B-A dan kichik yoki katta bo'lsa “ERROR” deb chiqarsin
Birinchi qatorda : Qaysi son yo'qligi
Ikkinchi qatorda : O'rniga qaysi son qo'yilgani
\(A\) va \(B\) ham kirishi shart.
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
4 4 8 4 5 6 7 9 |
8 9 |
2 |
3 4 8 4 5 6 7 8 9 |
ERROR |
E. Create Matrix
Xotira: 32 MB, Vaqt: 1000 msSizga A nomli belgi kiritiladi sizning qilishingiz kerak bo'lgan narsa, shu belgidan matrix yaratish
A belgi
Natija
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
1 |
111111 111111 111111 |
F. Partition Detection
Xotira: 32 MB, Vaqt: 1000 msCan you decide whether or not some walls
divide a rectangular room
into two or more partitions?
# | INPUT.TXT | OUTPUT.TXT |
---|
G. The Supermarket Queue
Xotira: 32 MB, Vaqt: 1000 msThere is a queue for the self-checkout tills at the supermarket. Your task is write a function to calculate the total time required for all the customers to check out!
- customers: an array of positive integers representing the queue. Each integer represents a customer, and its value is the amount of time they require to check out.
- n: a positive integer, the number of checkout tills.
The function should return an integer, the total time required.
Please look at the examples and clarifications below, to ensure you understand the task correctly :)
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
1 2 3 4 1 |
10 |
H. Count the smiley faces!
Xotira: 32 MB, Vaqt: 1000 msGiven an array (arr) as an argument complete the function countSmileys
that should return the total number of smiling faces.
Rules for a smiling face:
- Each smiley face must contain a valid pair of eyes. Eyes can be marked as
:
or;
- A smiley face can have a nose but it does not have to. Valid characters for a nose are
-
or~
- Every smiling face must have a smiling mouth that should be marked with either
)
orD
No additional characters are allowed except for those mentioned.
Valid smiley face examples: :) :D ;-D :~)
Invalid smiley faces: ;( :> :} :]
# | INPUT.TXT | OUTPUT.TXT |
---|
I. Highest Scoring Word
Xotira: 32 MB, Vaqt: 1000 msGiven a string of words, you need to find the highest scoring word.
Each letter of a word scores points according to its position in the alphabet: a = 1, b = 2, c = 3
etc.
For example, the score of abad
is 8
(1 + 2 + 1 + 4).
You need to return the highest scoring word as a string.
If two words score the same, return the word that appears earliest in the original string.
All letters will be lowercase and all inputs will be valid.
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
take me to semynak |
semynak |