A. Max {arr}

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Sizga \(a\) massiv berilgan, sizning qilishingiz kerak bo'lgan ish.

Massivdagi eng katta qiymatni chiqarish

Kiruvchi ma'lumotlar:

\(INPUT.TXT\) A massiv

Chiquvchi ma'lumotlar:

\(OUTPUT.TXT\) Masala javobi chop eting

Misollar:
# INPUT.TXT OUTPUT.TXT
1
1 2 3 4 5 6 7 8 9
9

B. Search {arr}

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Sizga \(a\) massiv va \(b\) soni beriladi, sizning qilishingiz kerak bo'lgan ish
\(A\) massiv ichida \(B\) sonini topish

Kiruvchi ma'lumotlar:

\(INPUT.TXT\) Birinchi qatorda - massiv

Ikkinchi qatorda - son

Chiquvchi ma'lumotlar:

\(OUTPUT.TXT\) Natijani chop eting, agarda ilojisi bo'lmasa “-1” deb chiqarsin, ilojisi bo'lsa index+1 ni chop eting

Misollar:
# 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 ms
Masala

Sizga ma'lumot turlarining nomi kiritiladi.

Sizning qilishingiz kerak bo'lgan ish, nechi byte ekanligi topishingiz kerak

Kiruvchi ma'lumotlar:

\(INPUT.TXT\) Sizga bir ma'lumot turi beriladi

Chiquvchi ma'lumotlar:

\(OUTPUT.TXT\) Masala javobini chop eting

Misollar:
# INPUT.TXT OUTPUT.TXT
1
int
4
2
bool
1

D. Qidiruv

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Asadbek 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!

Kiruvchi ma'lumotlar:

\(INPUT.TXT\)  

1-qatorda N soni, A va B sonlari

2-qatorda N+1 ta sondan iborat massiv kiritiladi

Chiquvchi ma'lumotlar:

\(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

Izoh:

\(A\) va \(B\) ham kirishi shart.

 

Misollar:
# 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 ms
Masala

Sizga A nomli belgi kiritiladi sizning qilishingiz kerak bo'lgan narsa, shu belgidan matrix yaratish

Kiruvchi ma'lumotlar:

A belgi

Chiquvchi ma'lumotlar:

Natija

Misollar:
# INPUT.TXT OUTPUT.TXT
1
1
111111
111111
111111

F. Partition Detection

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Can you decide whether or not some walls divide a rectangular room into two or more partitions?

Kiruvchi ma'lumotlar:
Chiquvchi ma'lumotlar:
Misollar:
# INPUT.TXT OUTPUT.TXT

G. The Supermarket Queue

Xotira: 32 MB, Vaqt: 1000 ms
Masala

There 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!

 

Kiruvchi ma'lumotlar:
  • 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.
Chiquvchi ma'lumotlar:

The function should return an integer, the total time required.


 

Izoh:

Please look at the examples and clarifications below, to ensure you understand the task correctly :)


 

Misollar:
# INPUT.TXT OUTPUT.TXT
1
1 2 3 4
1
10

H. Count the smiley faces!

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Given 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 ) or D

No additional characters are allowed except for those mentioned.

Valid smiley face examples: :) :D ;-D :~)
Invalid smiley faces: ;( :> :} :]

Kiruvchi ma'lumotlar:
Chiquvchi ma'lumotlar:
Misollar:
# INPUT.TXT OUTPUT.TXT

I. Highest Scoring Word

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Given 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.

Kiruvchi ma'lumotlar:
Chiquvchi ma'lumotlar:
Misollar:
# INPUT.TXT OUTPUT.TXT
1
take me to semynak
semynak
Kitob yaratilingan sana: 22-Feb-25 09:39