fork download
  1. solution for D
  2.  
  3. sort cs array
  4. get divisors of x1 & x2
  5.  
  6. for(i=1 ; i < div_1.size ; i++)
  7. {
  8. #servers = div_1[i-1]+1;
  9. #needed_Units = x1/div_1[i];
  10.  
  11. last_ind = BS on cs to get minimum c greater than or equal needed_units
  12.  
  13. first_ind = last_ind - servers + 1
  14.  
  15. for(j=1 ; j < div_2.size ; j++)
  16. {
  17. #servers2 = div_2[i-1]+1;
  18. #needed_Units2 = x2/div_2[i];
  19.  
  20. if(#servers2 >= first_ind)
  21. last_ind2 = #servers2 - first_ind + last_ind
  22. else
  23. last_ind2 = #servers2 - 1
  24.  
  25. if(cs[last_ind2] >= needed_Units2)
  26. Print();
  27. return ;
  28. }
  29. }
  30.  
  31. cout << No;
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
solution for D 
^
Main.java:6: error: class, interface, or enum expected
for(i=1 ; i < div_1.size ; i++)
          ^
Main.java:6: error: class, interface, or enum expected
for(i=1 ; i < div_1.size ; i++)
                           ^
Main.java:9: error: illegal character: '#'
	#servers = div_1[i-1]+1;
	^
Main.java:10: error: illegal character: '#'
	#needed_Units = x1/div_1[i];
	^
Main.java:10: error: class, interface, or enum expected
	#needed_Units = x1/div_1[i];
	              ^
Main.java:12: error: class, interface, or enum expected
	last_ind = BS on cs to get minimum c greater than or equal needed_units
	^
Main.java:16: error: class, interface, or enum expected
	for(j=1 ; j < div_2.size ; j++)
	          ^
Main.java:16: error: class, interface, or enum expected
	for(j=1 ; j < div_2.size ; j++)
	                           ^
Main.java:19: error: illegal character: '#'
		#servers2 = div_2[i-1]+1;
		^
Main.java:20: error: illegal character: '#'
		#needed_Units2 = x2/div_2[i];
		^
Main.java:20: error: class, interface, or enum expected
		#needed_Units2 = x2/div_2[i];
		               ^
Main.java:22: error: class, interface, or enum expected
		if(#servers2 >= first_ind)
		^
Main.java:22: error: illegal character: '#'
		if(#servers2 >= first_ind)
		   ^
Main.java:23: error: illegal character: '#'
			last_ind2 = #servers2 - first_ind + last_ind
			            ^
Main.java:25: error: illegal character: '#'
			last_ind2 = #servers2 - 1
			            ^
Main.java:29: error: class, interface, or enum expected
			return ;
			^
Main.java:30: error: class, interface, or enum expected
		}
		^
18 errors
stdout
Standard output is empty