Algorithms UZ
Відкрити в Telegram
Kanal egasi: @Bekzhanov_rasul “ Dunyoda ilmdan boshqa najot yoq va bolmagay. ” Imom Al-Buxoriy. Muhokama gruh: @Programmer_TK_Chat
Показати більше202
Підписники
Немає даних24 години
Немає даних7 днів
Немає даних30 днів
Архів дописів
QuickSort function_PY:
def qsort(L):
if L == []: return []
return qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + \
qsort([x for x in L[1:] if x>=L[0]])
// 932-misol PY
from math import *
t = int(input())
add = []
for i in range (t):
n = int(input())
add.append(n)
for j in range (len(add)):
print(add[j])
// 250-misol PY
Obunachimiz tomonidan
s=input()
a=0
for i in s:
if i=='s' or i=='z':
a+=4
elif i=='c' or i=='f' or i=='i' or i=='l' or i=='o' or i=='r' or i=='v' or i=='y':
a+=3
elif i=='b' or i=='e' or i=='h' or i=='k' or i=='n' or i=='q' or i=='u' or i=='x':
a+=2
elif i==' ' or i=='a' or i=='d' or i=='g' or i=='j' or i=='m' or i=='p' or i=='t' or i=='w':
a+=1
print(a)
// 16-misol PY
Obunachimiz tomonidan
a=[1000000000,1000000,1000,100]
b=["milliard ","million ","ming ","yuz "]
c=["","o'n ","yigirma ","o'ttiz ","qirq ","ellik ","oltmish ","yetmish ","sakson ","to'qson "]
d=["","bir ","ikki ","uch ","to'rt ","besh ","olti ","yetti ","sakkiz ","to'qqiz "]
def Natural(n):
# n=str(n)
for i in range(4):
if n>=a[i]:
return Natural(n//a[i])+b[i]+Natural(n%a[i])
return c[n//10]+d[n%10]
n=int(input())
a=Natural(n)
print(a)
// 700-misol PY
Obunachimiz tomonidan
n = int(input())
if n % 4 == 0:
print(4)
else:
print(0)
// 119-misol PY
Obunachimiz tomonidan
n = int(input())
x = 0
if n % 4 == 0:
x = n // 2
else:
x = -1
print(x)
// 27-misol PY
Obunachimiz tomonidan
t = int(input())
while(t>0):
t = t - 1
x, y = map(int,input().split())
if(x//2>y):
ans = y*2+1
else:
ans = (x-y-1)*2
print(ans)
// 2 - masala JAVA
Obunachimiz tomonidan
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in) ;
long a = sc.nextLong();
long b = sc.nextLong();
if(a>b){
System.out.println(">");
} else if(b>a){
System.out.println("<");
} else {
System.out.println("=");
}
}
}
// 1-misol JAVA
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int a, b;
a = in.nextInt();
b = in.nextInt();
System.out.println(a + b);
in.close();
}
}// 83-misol PY
Obunachilarimiz tomonidan
s,t = map(int,input().split())
a,b = map(int,input().split())
m,n = map(int,input().split())
d = list(map(int,input().split()))
d1 = list(map(int,input().split()))
x = 0
y = 0
for i in d:
if i >= (s-a) and i <= (t-a):
x+=1
for j in d1:
if j <= (t - b) and j >= (s - b):
y += 1
print(x)
print(y)
🖇 Repl.it
Dasturlash tillarida kod yozish uchun onlayn compiller va onlayn cabinet👩💻🧑💻
