Exemplo n.º 1
0
 public static void main(String[] args) {
   Scanner scanner = new Scanner(System.in);
   int nt = scanner.nextInt();
   scanner.nextLine();
   assert 1 <= nt && nt <= 100 : "out of range, nt: " + nt;
   for (int it = 1; it <= nt; it++) {
     Bravo o = Bravo.load(scanner);
     System.out.printf("Case #%d: %s\n", it, numors(o.solve(it), "IMPOSSIBLE"));
   }
 }
Exemplo n.º 2
0
 public static void main(String[] args) {
   Scanner scanner = new Scanner(System.in);
   int t = scanner.nextInt();
   scanner.nextLine();
   assert 1 <= t && t <= 10 : "out of range, t: " + t;
   for (int it = 1; it <= t; it++) {
     Bravo o = Bravo.load(scanner);
     System.out.printf("Case #%d: %.7f\n", it, o.solve());
   }
 }
Exemplo n.º 3
0
 public static void main(String[] args) {
   FastScanner scanner = new FastScanner(System.in);
   int n = scanner.nextInt();
   int m = scanner.nextInt();
   assert 1 <= n && n <= 1e6 : "out of range, n: " + n;
   assert 2 <= m && m <= 1e3 : "out of range, m: " + m;
   int[] A = new int[n];
   for (int i = 0; i < A.length; i++) {
     A[i] = scanner.nextInt();
     assert 0 <= A[i] && A[i] <= 1e9 : "out of range, A[i]: " + A[i];
     if (A[i] == 0) {
       System.out.println("YES");
       return;
     }
   }
   Bravo o = new Bravo(n, m, A);
   System.out.println((o.solve()) ? "YES" : "NO");
 }