結果

問題 No.2664 Prime Sum
ユーザー ks2mks2m
提出日時 2024-03-08 21:20:35
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,226 bytes
コンパイル時間 2,141 ms
コンパイル使用メモリ 78,108 KB
実行使用メモリ 55,780 KB
最終ジャッジ日時 2024-03-08 21:20:41
合計ジャッジ時間 5,947 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
53,988 KB
testcase_01 WA -
testcase_02 AC 54 ms
53,992 KB
testcase_03 AC 56 ms
53,976 KB
testcase_04 AC 53 ms
53,976 KB
testcase_05 AC 84 ms
54,828 KB
testcase_06 AC 70 ms
54,748 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 62 ms
54,008 KB
testcase_13 AC 82 ms
54,888 KB
testcase_14 AC 76 ms
54,892 KB
testcase_15 AC 119 ms
54,876 KB
testcase_16 AC 86 ms
54,896 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 71 ms
54,776 KB
testcase_23 AC 95 ms
55,780 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 54 ms
53,984 KB
testcase_27 AC 56 ms
53,984 KB
testcase_28 AC 55 ms
53,980 KB
testcase_29 AC 57 ms
53,980 KB
testcase_30 AC 53 ms
53,992 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 54 ms
53,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int n = Integer.parseInt(sa[0]);
		int m = Integer.parseInt(sa[1]);
		Node2[] arr = new Node2[n];
		for (int i = 0; i < n; i++) {
			Node2 o = new Node2();
			arr[i] = o;
		}
		for (int i = 0; i < m; i++) {
			sa = br.readLine().split(" ");
			int a = Integer.parseInt(sa[0]) - 1;
			int b = Integer.parseInt(sa[1]) - 1;
			arr[a].nexts.add(b);
			arr[b].nexts.add(a);
		}
		br.close();

//		Queue<Integer> que = new ArrayDeque<>();
//		que.add(0);
//		arr[0].grp = 1;
//		while (!que.isEmpty()) {
//			int cur = que.poll();
//			for (int next : arr[cur].nexts) {
//				if (arr[next].grp == 0) {
//					que.add(next);
//					arr[next].grp = 3 - arr[cur].grp;
//				} else if (arr[next].grp == arr[cur].grp) {
//					System.out.println("No");
//					return;
//				}
//			}
//		}
		System.out.println("Yes");
	}

	static class Node2 {
		int grp;
		Integer target;
		List<Integer> nexts = new ArrayList<>();
	}
}
0