Startup and Tech
Friday, 31 July 2020
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
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment