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;i +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<