Algorithms UZ
Open in Telegram
Kanal egasi: @Bekzhanov_rasul “ Dunyoda ilmdan boshqa najot yoq va bolmagay. ” Imom Al-Buxoriy. Muhokama gruh: @Programmer_TK_Chat
Show more202
Subscribers
No data24 hours
No data7 days
No data30 days
Posts Archive
Assalomu alaykum
Hurmatli obunachilarimiz.
Sizda kanal faoliyati yuzasidan savol va takliflariz bòlsa mana shu
👇👇👇👇👇
@Developerss_uzb profilga murojat qilishingiz mumkin.
//127-misol c++
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> a(n);
for(int i = 0; i < n; i++)
cin >> a[i];
sort(a.begin(), a.end());
cout << a[(n - 1) / 2];
}
❗️ Diqqat Musobaqa ❗️
ROBOCONTEST ROUND #69 YANGI YIL BILAN!
29.12.2022 kuni, 20:00 da Robocontest.uz’da navbatdagi contest bo'lib o'tadi.
👉 Qatnashish uchun ariza topshirish
👉 Agar savollar bo’lsa @robocontest_chat ga murojaat qiling.
👉 @robocontest
Hammaga salom!
Algorithms Uz Kanali.
Bu kanalda contest va masalalar ishlap boriladi!
Robocontest
Algo
ACMP
@algorithms_teacher
// 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)
// 376-misol C++
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n;
cin>>n;
switch(n)
{
case 1:
case 2:
case 12:
cout<<"Winter";break;
case 3:
case 4:
case 5:
cout<<"Spring";break;
case 6:
case 7:
case 8:
cout<<"Summer";break;
case 9:
case 10:
case 11:
cout<<"Autumn"; break;
default:
cout<<"Error";break;
}
return 0;
}
// 612-misol C++
#include<iostream>
using namespace std;
int main(){
int k,l;
char a,b;
cin >> a >>b;
k=a; l=b;
cout << (k-64)+(l-64);
}
//14-misol PY
a,b =map(int,input().split())
mod=1000000007
if a==0:
print('1')
else:
c=pow(b+1,a,mod)
print(c)
// 481-misol C++
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,p,x,s=0,k=0,j;
cin>>n;
j=n;
x=log(n)*1./log(10)+1;
while(n>0)
{
p=n%10;
n=n/10;
s=s+pow(p,x);
k=k+p;
}
if(j==s)
{
cout<<k;
}
else{
cout<<j;
}
return 0;
}
// 501-misol c++
#include <bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
#define fast(x) ios_base::sync_with_stdio(false);cin.tie(x);cout.tie(x);
#define pb push_back
#define vi vector<int>
std::ostream& operator <<(std::ostream& os, const __int128 i) noexcept{
std::ostream::sentry s(os);
if(s){
unsigned __int128 tmp = i<0 ? i:i;
char buffer[128];
char *d=std::end(buffer);
do{
--d;
*d="0123456789"[tmp%10];
tmp/=10;
}while(tmp!=0);
if(i<0){
--d;
*d='-';
}
int len = int(std::end(buffer)-d);
if(os.rdbuf()->sputn(d,len)!=len){
os.setstate(std::ios_base::badbit);
}
}
return os;
}
#define int1 __int128
#define int long long
void solve(){
fast(0);
int n;
cin>>n;
cout<<int1((7*int1(pow(n,2)) - 7*n + 2)/2);
}
signed main(){
int t=1;
// cin>>t;
while(t--){
solve();
cout<<'\n';
}
return 0;
}
// 6-misol C++
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n;
k=log(n)/log(10)+1;
if(n%400==0||n%4==0&&n%100!=0)
{
if(k==1){cout << "12/09/000"<< n ;}
if(k==2){cout << "12/09/00"<< n ;}
if(k==3){cout << "12/09/0"<< n ;}
if(k==4){cout << "12/09/"<< n ;}
}
else{
if(k==1){cout << "13/09/000"<< n ;}
if(k==2){cout << "13/09/00"<< n ;}
if(k==3){cout << "13/09/0"<< n ;}
if(k==4){cout << "13/09/"<< n ;}
}
return 0;
}
// 549-misol C++da
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
int h=0,j=0;
cin>>s;
for (int i=0; i<s.length(); i++)
{
if(s[i]=='z')
{
h++;
}
else{
j++;
}
}
if(2*h==j)
{
cout << "Yes";
}
else{
cout << "No";
}
return 0;
}
// 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)
Assalomu alaykum qadri qaddidan baland obunachilarmiz.
303ta obunachi bòlibdi ajoyib😌😌😊
