Deutsch
Telegram

Beitragimport java.io.*;

19. Juli 2026
D
Deloitte | COGNIZANT | IBM | CAPGEMINI
import java.io.*; import java.util.*; public class TestClass { public static void droneservicesschedule(int[][] arr, int M, int N) { List<List<Integer>> adj = new ArrayList<>(); for (int i = 0; i <= N; i++) { adj.add(new ArrayList<>()); } int[] degree = new int[N + 1]; for (int i = 0; i < M; i++) { int u = arr[i][0]; int v = arr[i][1]; adj.get(u).add(v); adj.get(v).add(u); degree[u]++; degree[v]++; } boolean[] visited = new boolean[N + 1]; List<List<Integer>> components = new ArrayList<>(); for (int i = 1; i <= N; i++) { if (!visited[i]) { List<Integer> comp = new ArrayList<>(); Queue<Integer> queue = new LinkedList<>(); queue.add(i); visited[i] = true; while (!queue.isEmpty()) { int curr = queue.poll(); comp.add(curr); for (int neighbor : adj.get(curr)) { if (!visited[neighbor]) { visited[neighbor] = true; queue.add(neighbor); } } } components.add(comp); } } if (components.size() > 2) { System.out.println("Not a Complete Day"); return; } for (List<Integer> comp : components) { int K = comp.size(); for (int vertex : comp) { if (degree[vertex] != K - 1) { System.out.println("Not a Complete Day"); return; } } } System.out.println("Complete Day"); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); if (!sc.hasNextInt()) return; int T = sc.nextInt(); for (int j = 0; j < T; j++) { int N = sc.nextInt(); int M = sc.nextInt(); int[][] arr = new int[M][2]; for (int i = 0; i < M; ++i) { arr[i][0] = sc.nextInt(); arr[i][1] = sc.nextInt(); } droneservicesschedule(arr, M, N); } } }
939 ·

In der Nähe im Feed

DDeloitte | COGNIZANT | IBM | CAPGEMINIFotoDDeloitte | COGNIZANT | IBM | CAPGEMINIimport java.io.*; import java.util.*; public class TestClass { static int[] dr = {-1, 1, 0, 0}; static int[] dc = {0, 0, -1, 1}; static int minNumOfwalls(int[][
diese Nachricht
DDeloitte | COGNIZANT | IBM | CAPGEMINIHCL ON-CAMPUS EXAM✅ Contact : @MLCODER2DDeloitte | COGNIZANT | IBM | CAPGEMINIAMAZON SDE ROUND-1✅✅ Contact : @MLCODER2
DDeloitte | COGNIZANT | IBM | CAPGEMINIDeloitte | COGNIZANT | IBM | CAPGEMINI@python_java_Coding · Kanal · Technik
7 178Abonnenten560durchschnittliche Beitragsreichweite
Community-Feed In Telegram öffnen

Ein offener öffentlicher Feed aus dem Suchindex ChatCrawler — „Google für das öffentliche Telegram“; wird aktualisiert, während die Community gecrawlt wird. Zeiten in UTC.

Nur öffentliche Inhalte, offizielle Telegram-API. Über uns · FAQ · Grenzen des Index · Seite entfernen · Katalog · Suche · So zählen wir