From 425b61e2c65bb06b95f95a234628b2606233b9e1 Mon Sep 17 00:00:00 2001 From: zakariatabati Date: Sun, 7 Jan 2024 19:18:21 +0100 Subject: [PATCH] Adding some codeforces problems with solutions --- codeforce/Anton and Danik.py | 8 +++ codeforce/Anton and Letters.py | 7 +++ codeforce/Anton and Polyhedrons.py | 15 ++++++ codeforce/Bear and Big Brother.py | 9 ++++ codeforce/Beautiful Matrix.cpp | 26 +++++++++ codeforce/Bit++.py | 9 ++++ codeforce/Black square.cpp | 33 ++++++++++++ codeforce/Boy or Girl.py | 5 ++ codeforce/Calculating Function.py | 5 ++ codeforce/Free ice cream.cpp | 17 ++++++ codeforce/Games.cpp | 23 ++++++++ codeforce/Gravity Flip.cpp | 30 +++++++++++ codeforce/Helpful Maths.py | 16 ++++++ codeforce/Hulk.py | 21 ++++++++ codeforce/Insomnia cure.py | 10 ++++ .../Is your horseshoe on the other hoof.py | 4 ++ codeforce/List of the problems.xlsx | Bin 0 -> 15081 bytes codeforce/Magnets.cpp | 24 +++++++++ ...hmoud and Longest Uncommon Subsequence.cpp | 19 +++++++ codeforce/Minutes Before the New Year.py | 9 ++++ codeforce/Next Round.py | 7 +++ codeforce/Pangram.py | 17 ++++++ codeforce/Petya and Strings.py | 11 ++++ codeforce/Phone Numbers.py | 11 ++++ codeforce/Police recruits.cpp | 24 +++++++++ codeforce/Presents.py | 8 +++ codeforce/Serja and Dima.cpp | 51 ++++++++++++++++++ codeforce/Soldier and Bananas.py | 8 +++ codeforce/Stones on the Table.py | 8 +++ codeforce/Team.py | 7 +++ codeforce/Ultra-Fast Mathematician.py | 10 ++++ codeforce/Vanya and Fence.py | 9 ++++ codeforce/Watermelon.py | 10 ++++ codeforce/Way Too Long Words.py | 11 ++++ codeforce/Word Capitalization.py | 5 ++ codeforce/jucier.cpp | 31 +++++++++++ 36 files changed, 518 insertions(+) create mode 100644 codeforce/Anton and Danik.py create mode 100644 codeforce/Anton and Letters.py create mode 100644 codeforce/Anton and Polyhedrons.py create mode 100644 codeforce/Bear and Big Brother.py create mode 100644 codeforce/Beautiful Matrix.cpp create mode 100644 codeforce/Bit++.py create mode 100644 codeforce/Black square.cpp create mode 100644 codeforce/Boy or Girl.py create mode 100644 codeforce/Calculating Function.py create mode 100644 codeforce/Free ice cream.cpp create mode 100644 codeforce/Games.cpp create mode 100644 codeforce/Gravity Flip.cpp create mode 100644 codeforce/Helpful Maths.py create mode 100644 codeforce/Hulk.py create mode 100644 codeforce/Insomnia cure.py create mode 100644 codeforce/Is your horseshoe on the other hoof.py create mode 100644 codeforce/List of the problems.xlsx create mode 100644 codeforce/Magnets.cpp create mode 100644 codeforce/Mahmoud and Longest Uncommon Subsequence.cpp create mode 100644 codeforce/Minutes Before the New Year.py create mode 100644 codeforce/Next Round.py create mode 100644 codeforce/Pangram.py create mode 100644 codeforce/Petya and Strings.py create mode 100644 codeforce/Phone Numbers.py create mode 100644 codeforce/Police recruits.cpp create mode 100644 codeforce/Presents.py create mode 100644 codeforce/Serja and Dima.cpp create mode 100644 codeforce/Soldier and Bananas.py create mode 100644 codeforce/Stones on the Table.py create mode 100644 codeforce/Team.py create mode 100644 codeforce/Ultra-Fast Mathematician.py create mode 100644 codeforce/Vanya and Fence.py create mode 100644 codeforce/Watermelon.py create mode 100644 codeforce/Way Too Long Words.py create mode 100644 codeforce/Word Capitalization.py create mode 100644 codeforce/jucier.cpp diff --git a/codeforce/Anton and Danik.py b/codeforce/Anton and Danik.py new file mode 100644 index 0000000..0e39844 --- /dev/null +++ b/codeforce/Anton and Danik.py @@ -0,0 +1,8 @@ +n = int(input()) +s = input() +if s.count('A')>s.count('D'): + print("Anton") +if s.count('A')b : + break + x =x+1 +print(x) diff --git a/codeforce/Beautiful Matrix.cpp b/codeforce/Beautiful Matrix.cpp new file mode 100644 index 0000000..493af91 --- /dev/null +++ b/codeforce/Beautiful Matrix.cpp @@ -0,0 +1,26 @@ +#include +#include +using namespace std; +int main() +{ + int arr[5][5]; + int b=0,r=0,c=0; + for (int i=0;i<5;i++) + { + for (int j =0;j<5;j++ ) + { + cin>>arr[i][j]; + } + } + for(int i=0;i<5;i++) + { + for(int j=0;j<5;j++) + { + if (arr[i][j] == 1) + { + cout< +using namespace std; +int main() +{ + int sum=0,a=0,b=0,c=0,d=0; + int arr[4]; + for (int i=0;i<4;i++) + { + cin>>arr[i]; + } + string s; + cin>>s; + for(int i=0;i +#include +using namespace std; +int main() +{ + int a,b; + int m; + int c; + cin>>a>>b; + m=max(a,b); + c=(6-(a-1))/6; + cout< +using namespace std; +int main() +{ + int ans=0; + int n;cin>>n; + int h[n],a[n]; + for(int k=0;k>h[k]>>a[k]; + } + for(int i=0;i +using namespace std; +int main() +{ + int n;cin>>n; + int arr[n]; + int temp; + for (int k=0;k>arr[k]; + } + for(int i = 0;iEF z&gqBlE_F$zs+Lq$l1f1u6buar0tgBS2#6Snler_-6Br065F7{y6$lFCqlm4Ild+AH zu8O;zv7VJ&XOI6nNImsOYi2u_#wCI6W#LpKt6KJ?SEWd}YZyYWQD~`sB$S#!4;m6` z^IBwb3g`Fxt^ur|T+EMU0;f!5U`Vy2I1a?FBi`zm=wO5voOp5nZBCx4p0Zf`WUI3o zuggr5f@ZSVVxdiI{&FCwZ>2@dgJ9?TOfOnt6pKsM6P#~*Bnv|TF0A>B*aiZAFCPSp zPgOFKJ~vb>2m40FG=WfC3N5;zd{|pkdyC)K1#N0|$8o;`mlo$m(tR!;pYQP-yq7aj zcJAo6^7T=t?hyWh5D1^IHR=el+;_CJUCd0=AiM)V_G5ED0<`k&4HQV>KXkT1m5KBk zAc!&mm4pT8tgeHxl_Mj=&-?%C>i=K`{kN`{$H~g~Fu?_%Nj`@R-p#JYAPGym3Q4vR ztN8dytspi;<&)vAex<}iQo#uTmGJHGc^+O~<&8QVB);8ZD~~`y;~{Nytq4wjw0DN2 zp>RkNw=du9MRu9JnY~Swc<)Z-((#$5thpptdT5mFZGjV zzwC!KgZoP0Sz+aqis0%d&YZ*eiFDujq@n|Oflw})U_CII7BK zT;|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h#76rHHiq7pL>aXmPUlP?-nec3>bOl%lOj)H;_ywa5H z7@BfyfvZx~!=Lt7Z3xE0|CT3a?;d+WvD@%TLYY%90}R(Ku94c-q29Stin-AXHhgiA zryg^@L2>khX z9~R19HTbM?;L#ndl&rk5t;}kpt%=$9n*Pmv87&j|S*z;U1VG65b_WW(1?^<6ce^O) z%(-^`$J6amRB9EETlYFD#4naBot$qxd3&yn;%xp7u0!G>IS(>%Q+To;2(7jo~GKiP6Sj&tgy%0E(i;$kHJ zza#%=zWCp$KtR{fzmWf5vd4d?^LrBU-;^lf{>8+9r4;{8<@a#i-&8>H|1o&?JAvO_ zr+*V@2JG1YWAV2m^>@_YT^N6(T2lRi`nyBpcM8An5dWqiNBjF2{NsM{cY?pK`~N05 z1Xv*gdh^?=|M&8*UBK@|e_uuZO>`2l@dXh5uQlcG6#jF;@HakSbHV}y^k2(|-_ifm i)c-qrIorRX|7rLYq`?7F{L>K*4`c>V1WV4JrT+)LTlaVX literal 0 HcmV?d00001 diff --git a/codeforce/Magnets.cpp b/codeforce/Magnets.cpp new file mode 100644 index 0000000..431cbaa --- /dev/null +++ b/codeforce/Magnets.cpp @@ -0,0 +1,24 @@ +#include +using namespace std; +int main() +{ + int n;cin>>n; + int gp=1; + string temp,value; + for (int i =0;i>value; + if (i ==0) + { + temp=value; + continue; + } + if (temp[1] == value[0]) + { + ++gp; + } + temp=value; + + } + cout< +using namespace std; +int main() +{ + string a,b; + cin>>a>>b; + if (a==b) + { + cout<<-1; + } + else if (a.length()==b.length() && a!=b) + { + cout<=int(l[k-1]) : + c=c+1 +print(c) diff --git a/codeforce/Pangram.py b/codeforce/Pangram.py new file mode 100644 index 0000000..ee258aa --- /dev/null +++ b/codeforce/Pangram.py @@ -0,0 +1,17 @@ +def Pangram(s): + L = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] + s = s.upper() + z = set(s) + T = [] + for i in L: + if i in z: + T.append(True) + + if len(T) == 26 : + return "Yes" + else: + return "No" + +n = int(input()) +s = input() +print(Pangram(s)) diff --git a/codeforce/Petya and Strings.py b/codeforce/Petya and Strings.py new file mode 100644 index 0000000..39a49a9 --- /dev/null +++ b/codeforce/Petya and Strings.py @@ -0,0 +1,11 @@ +def retur(s1,s2): + if s1 > s2: + return 1 + elif s1 < s2: + return -1 + else: + return 0 + +st1 = str(input().lower()) +st2 = str(input().lower()) +print(retur(st1,st2)) diff --git a/codeforce/Phone Numbers.py b/codeforce/Phone Numbers.py new file mode 100644 index 0000000..d20c4e0 --- /dev/null +++ b/codeforce/Phone Numbers.py @@ -0,0 +1,11 @@ +t = int(input()) +l = [] +for i in range(t): + a,b = map(str,input().split()) + b = list(b) + s = 0 + for i in b : + s = s+int(i) + if s%2 == 0: + l.append(a) +print(*l,sep='\n') diff --git a/codeforce/Police recruits.cpp b/codeforce/Police recruits.cpp new file mode 100644 index 0000000..03b3d03 --- /dev/null +++ b/codeforce/Police recruits.cpp @@ -0,0 +1,24 @@ +#include +using namespace std; +int main() +{ + int n;cin>>n; + int sum=0,c=0; + int arr[n]; + for (int i=0;i>arr[i]; + } + for (int i=0;i +using namespace std; +int main() +{ + int n;cin>>n; + int s=0,d=0; + int l=0,r=n-1; + bool p=true; + int arr[n]; + for (int i=0;i>arr[i]; + } + while (l<=r) + { + if (arr[l] > arr[r]) + { + if(p){ + s+=arr[l]; + } + else + { + d+=arr[l]; + } + l++; + } + else + { + if(p) + { + s+=arr[r]; + } + else + { + d+=arr[r]; + } + r--; + } + if (p) + { + p=false; + } + else + { + p=true; + } + } + cout<n: + print(price-n) +else: + print(0) diff --git a/codeforce/Stones on the Table.py b/codeforce/Stones on the Table.py new file mode 100644 index 0000000..20a24f8 --- /dev/null +++ b/codeforce/Stones on the Table.py @@ -0,0 +1,8 @@ +n = int(input()) +s = input() +x = 0 +for i in range(0,n-1): + if s[i] == s[i+1]: + x = x+1 +print(x) + diff --git a/codeforce/Team.py b/codeforce/Team.py new file mode 100644 index 0000000..4e37d25 --- /dev/null +++ b/codeforce/Team.py @@ -0,0 +1,7 @@ +n = int(input()) +count = 0 +for i in range(n): + a= input().split() + if a.count('1')>=2: + count=count+1 +print(count) diff --git a/codeforce/Ultra-Fast Mathematician.py b/codeforce/Ultra-Fast Mathematician.py new file mode 100644 index 0000000..cfd057b --- /dev/null +++ b/codeforce/Ultra-Fast Mathematician.py @@ -0,0 +1,10 @@ +a = input() +b = input() +Nn = '' +for i in range(len(a)): + if a[i] != b[i]: + Nn = Nn+'1' + else: + Nn = Nn+'0' +print(Nn) + diff --git a/codeforce/Vanya and Fence.py b/codeforce/Vanya and Fence.py new file mode 100644 index 0000000..85485fe --- /dev/null +++ b/codeforce/Vanya and Fence.py @@ -0,0 +1,9 @@ +n,h = map(int,input().split()) +a = list(input().split()) +w = 0 +for i in a : + if int(i) > h: + w = w+2 + else: + w = w+1 +print(w) diff --git a/codeforce/Watermelon.py b/codeforce/Watermelon.py new file mode 100644 index 0000000..0649a5b --- /dev/null +++ b/codeforce/Watermelon.py @@ -0,0 +1,10 @@ +w = int(input()) +if w==2: + print("NO") +else: + if w%2 == 0: + if (w%2)%2==0: + print("YES") + else: + print("NO") + \ No newline at end of file diff --git a/codeforce/Way Too Long Words.py b/codeforce/Way Too Long Words.py new file mode 100644 index 0000000..02aa031 --- /dev/null +++ b/codeforce/Way Too Long Words.py @@ -0,0 +1,11 @@ +def WTLW(s): + a = len(s)-2 + return s[0]+str(a)+s[-1] +n = int(input()) +for i in range(n): + w = input() + if len(w)>10: + print(WTLW(w)) + else: + print(w) + diff --git a/codeforce/Word Capitalization.py b/codeforce/Word Capitalization.py new file mode 100644 index 0000000..fa92934 --- /dev/null +++ b/codeforce/Word Capitalization.py @@ -0,0 +1,5 @@ +def capitalization(word): + return word[0].upper()+word[1:] + +word = input() +print(capitalization(word)) diff --git a/codeforce/jucier.cpp b/codeforce/jucier.cpp new file mode 100644 index 0000000..a2a2b39 --- /dev/null +++ b/codeforce/jucier.cpp @@ -0,0 +1,31 @@ +#include +using namespace std; +int main() +{ + long long n,b,d,s=0; + int x=0; + cin>>n>>b>>d; + long long a[n]; + for(int i=0;i>a[i]; + + } + for(int i=0;id) + { + ++x; + s=0; + } + } + } + cout<