Startup and Tech
Tuesday 8 September 2020
Codeforces 1407A Solution -- Ahahahahahahahaha Solution In Python
Program
Read more »
Sunday 6 September 2020
Codeforces 1405A Solution -- Permutation Forgery Solution In Python
Program
Read more »
Friday 31 July 2020
Codeforces 110A Solution - Nearly Lucky Number Solution In Java
Program
import java.util.*; public class x { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String s = sc.next(); int f=0; char c[] = s.toCharArray(); for(int i=0;i<c.length;i++) { if(c[i]=='4' || c[i]=='7') { f++; } } if(f==0) { System.out.println("NO"); } else if(f>0) { if(f==4 || f==7 || f==47 || f==74) { System.out.println("YES"); } else { System.out.println("NO"); } } else { System.out.println("NO"); } } }
Output
I/P : 40047 O/P : NO
Codeforces 617A Solution - Elephant Solution In Java
Read more »
Codeforces 617A Solution - Elephant Solution In Java
Program
import java.util.*; public class x { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int sum=0; sum = sum+ n/5; n = n%5; sum =sum+ n/4; n = n%4; sum = sum+n/3; n = n%3; sum = sum+n/2; n = n%2; sum = sum+n/1; n = n%1; System.out.println(sum); } }
Output
I/P: ---- 5 ---- O/P: ---- 1
Codeforces 160A Solution - Twins Solution In Java
Read more »
Codeforces 160A Solution - Twins Solution In Java
Program
import java.util.*; public class x { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a[] = new int[n]; int res=0; int ans=0; double avg; int cnt=0; for(int i=0;i
=0;i--) { if(avg>=res) { res = res + a[i]; cnt++; } } System.out.println(cnt); } }
Output
I/P: ----- 2 3 3 ----- O/P: ----- 2
Codeforces 977A Soluton - Wrong Subtraction Solution In Java
Tuesday 28 July 2020
Codeforces 977A Solution - Wrong Subtraction Solution In Java
Program
Read more »
Sunday 26 July 2020
Codeforces 791A Solution - Bear and Big Brother Solution In Java
Program
Read more »
Older Posts
Home
Subscribe to:
Posts (Atom)