n = int(input())
a = list(map(int,input().split()))
c = 0
for i in range(n-1):
for j in range(i+1:n):
s1 = sum(list(map(int,bin(i)[2:].split())))
s2 = sum(list(map(int,bin(j)[2:].split())))
if s1 == s2:
c += 1
print(c)
Python
Bob and Numbers Code
Telegram- https://t.me/Coding_solution_0
a = list(map(int,input().split()))
c = 0
for i in range(n-1):
for j in range(i+1:n):
s1 = sum(list(map(int,bin(i)[2:].split())))
s2 = sum(list(map(int,bin(j)[2:].split())))
if s1 == s2:
c += 1
print(c)
Python
Bob and Numbers Code
Telegram- https://t.me/Coding_solution_0
https://t.me/Coding_solution_0
n = int(input())
a = list(map(int,input().split()))
c = 0
for i in range(n-1):
for j in range(i+1:n):
s1 = sum(list(map(int,bin(i)[2:].split())))
s2 = sum(list(map(int,bin(j)[2:].split())))
if s1 == s2:
c += 1
print(c)
Python
Bob and Numbers Code
Telegram- https://t.me/Coding_solution_0
n = int(input())
a = list(map(int,input().split()))
c = 0
for i in range(n-1):
for j in range(i+1:n):
s1 = sum(list(map(int,bin(i)[2:].split())))
s2 = sum(list(map(int,bin(j)[2:].split())))
if s1 == s2:
c += 1
print(c)
Python
Bob and Numbers Code
Telegram- https://t.me/Coding_solution_0
Python
Rooted tree with N nodes code
An array A of N integer code
Bob received n job invitations code
Telegram -
https://t.me/Coding_solution_0
Rooted tree with N nodes code
An array A of N integer code
Bob received n job invitations code
Telegram -
https://t.me/Coding_solution_0
n=int(input())
m=int(input())
s=input()
t=input()
def subString(s,n):
c=0
for i in range(n):
for len in range(i+1,n+1):
a=s[i: len]
c+=1
return c-2
if s==t:
print(1)
else:
if t in s:
print(subString(s,n))
else:
print(0)
Python
Telegram -
https://t.me/Coding_solution_0
m=int(input())
s=input()
t=input()
def subString(s,n):
c=0
for i in range(n):
for len in range(i+1,n+1):
a=s[i: len]
c+=1
return c-2
if s==t:
print(1)
else:
if t in s:
print(subString(s,n))
else:
print(0)
Python
Telegram -
https://t.me/Coding_solution_0
Java
Maximum possibility of unique digits in k divided subarrray of given arraylist
Telegram - https://t.me/Coding_solution_0
Maximum possibility of unique digits in k divided subarrray of given arraylist
Telegram - https://t.me/Coding_solution_0
Rooted tree with N nodes code
An array A of N integer code
Bob received n job invitations code
Telegram-
https://t.me/Coding_solution_0
An array A of N integer code
Bob received n job invitations code
Telegram-
https://t.me/Coding_solution_0
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(){
int t,count=0;
scanf("%d",&t);
for(int a0 = 0; a0 < t; a0++){
count=0;
int n;
int k;
scanf("%d %d",&n,&k);
int a[n];
for(int a_i = 0; a_i < n; a_i++){
scanf("%d",&a[a_i]);
}
for(int a_i = 0; a_i < n; a_i++){
if(a[a_i]<=0)
count++;
}
if(count<k)
printf("YES\n");
else
printf("NO\n");
//count=0;
}
return 0;
}
C language
Angry professor
Telegram- https://t.me/Coding_solution_0
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(){
int t,count=0;
scanf("%d",&t);
for(int a0 = 0; a0 < t; a0++){
count=0;
int n;
int k;
scanf("%d %d",&n,&k);
int a[n];
for(int a_i = 0; a_i < n; a_i++){
scanf("%d",&a[a_i]);
}
for(int a_i = 0; a_i < n; a_i++){
if(a[a_i]<=0)
count++;
}
if(count<k)
printf("YES\n");
else
printf("NO\n");
//count=0;
}
return 0;
}
C language
Angry professor
Telegram- https://t.me/Coding_solution_0
// C++ program to find minimum time
// required to produce m items.
#include<bits/stdc++.h>
using namespace std;
// Return the minimum time required to
// produce m items with given machines.
int minTime(int arr[], int n, int m)
{
// Initialize time, items equal to 0.
int t = 0;
while (1)
{
int items = 0;
// Calculating items at each second
for (int i = 0; i < n; i++)
items += (t / arr[i]);
// If items equal to m return time.
if (items >= m)
return t;
t++; // Increment time
}
}
// Driver Code
int main()
{
int arr[] = { 1, 2, 3 };
int n = sizeof(arr)/sizeof(arr[0]);
int m = 11;
cout << minTime(arr, n, m) << endl;
return 0;
}
Minimum time
C language
Telegram-
https://t.me/Coding_solution_0
// required to produce m items.
#include<bits/stdc++.h>
using namespace std;
// Return the minimum time required to
// produce m items with given machines.
int minTime(int arr[], int n, int m)
{
// Initialize time, items equal to 0.
int t = 0;
while (1)
{
int items = 0;
// Calculating items at each second
for (int i = 0; i < n; i++)
items += (t / arr[i]);
// If items equal to m return time.
if (items >= m)
return t;
t++; // Increment time
}
}
// Driver Code
int main()
{
int arr[] = { 1, 2, 3 };
int n = sizeof(arr)/sizeof(arr[0]);
int m = 11;
cout << minTime(arr, n, m) << endl;
return 0;
}
Minimum time
C language
Telegram-
https://t.me/Coding_solution_0
Rooted tree with N nodes code
An array A of N integer code
Bob received n job invitations code
Telegram- https://t.me/Coding_solution_0
An array A of N integer code
Bob received n job invitations code
Telegram- https://t.me/Coding_solution_0