Editorialga phyton hamda C++ tillarida ishtrokchilar ichidan eng optimal yechimlar qo'yildi โ
A masala
phytonda: Somebody yechimi
d=0
for x in input():
if d!=10 and "matematika"[d]==x:
d+=1
print("YES" if d==10 else "NO")
C++ da: Alisher Ozodov yechimi
#include"bits/stdc++.h"
#define int long long
#define nl '\n'
using namespace std;
main(){
string s;
cin>>s;
string ss="matematika";
int j=0;
for(int i=0;i<s.size();i++){
if(s[i]==ss[j]) j++;
if(j==ss.size()){
cout<<"YES"<<nl;
return 0;
}
}
cout<<"NO"<<nl;
}
B masala
phytonda: ShinobuKocho yechimi
m=int(input())
k=int(input())
print(m*1000/k)
C++ da: hech kim yechmagan ๐
agar siz yechsangiz men bilan bog'laning
C masala
phytonda: Otabek yechimi
x1,y1=map(int,input().split())
x2,y2=map(int,input().split())
print(int((x1+x2)/ 2 - (y1 - y2) / 2),int((y1 + y2) / 2 - (x2 - x1) / 2))
print(int((x1+x2)/2+(y1-y2)/2),int((y1+y2)/2+(x2-x1)/2))
C++ da: bu maslani ham hech kim yecha olmabdi ๐ Lekin keyin Alisher Ozodov men bilan bog'landi va yechdi โ
#include"bits/stdc++.h"
using namespace std;
main(){
int x1,y1,x2,y2;
cin>>x1>>y1>>x2>>y2;
cout<<static_cast<int>((x1+x2)/2.0-(y1-y2)/2.0)<<" "<<static_cast<int>((y1+y2)/2.0-(x2-x1)/2.0)<<endl;
cout<<static_cast<int>((x1+x2)/2.0+(y1-y2)/2.0)<<" "<<static_cast<int>((y1+y2)/2.0+(x2-x1)/2.0);
}
uni oqshlasak arzidi ๐๐คฉ๐ Alisher Ozodov
D masala
Phytonda: VestaCC yechimi
print("YES" if input()=="ULURDLDRULDRDLURDLU" else "NO" )
C++ da: Baxramov Feruzbek yechimi
#include<bits/stdc++.h>
using namespace std;
const int mod=1000000007;
int main() {
string s;
cin>>s;
if(s.back()=='U' && s[0]=='U' && s[1]=='L' && s[2]=='U' && s[3]=='R'){
cout<<"YES";
}else cout<<"NO";
return 0;
}
E masala
phytonda: Rahimberganov Munisbek yechimi
a=int(input)
print('2.093')
phytonda: khasanm yechimi
def func(a):
c = 3.14 * a
d = (3 * a) / 2
return "{:.3f}".format(c / d)
a = int(input())
print(func(a))
C++da: hech kim ishlay olmagan edi๐ค Lekin Alisher Ozodov men bilan bog'landi va bu maslani ham yecha oldi ๐
#include"bits/stdc++.h"
using namespace std;
main(){
int n;
cin>>n;
cout<<fixed<<setprecision(3)<<(n*3.14)/(n*1.5*1.0);
}
Alisher Ozodov dan double ๐๐๐ค
F masala
phython da: Otabek Aralov Abduxamitovich yechimi
m,n=map(int,input().split())
a=list(map(int,input().split()))
t=int(input())
a.sort(reverse=True)
s=0
l=[]
for i in a:
if i>m:
s=s+1
else:
l.append(i)
for i in l:
if t>=i:
s=s+1
t=t-i
else:
break
print(s)
phytonda : Rahimberganov Musobek yechimi
m,n=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
t=int(input())
s=0
for i in a:
if i>m:
s+=1
if t>i:
s+=1
t-=i
print(s)
C++ da: Hech kim ishlamagan ๐คฏ๐ฅถ
agar siz yechsangiz men bilan bog'laning