fork download
  1. public class BearDartsDiv2 {
  2. public long count(int[] w) {
  3. final int LIM = 1000 * 1000;
  4. int[] m = new int[LIM + 1];
  5. int n = w.length;
  6. long result = 0;
  7. for(int d = 0; d < n; ++d) {
  8. result += m[w[d]];
  9. for(int a = 0; a < d; ++a)
  10. for(int b = a + 1; b < d; ++b) {
  11. long mul = (long) w[a] * w[b] * w[d];
  12. if(mul <= LIM) m[(int) mul]++;
  13. }
  14. }
  15. return result;
  16. }
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class BearDartsDiv2 is public, should be declared in a file named BearDartsDiv2.java
public class BearDartsDiv2 {
       ^
1 error
stdout
Standard output is empty