結果

問題 No.488 四角関係
ユーザー fal_rndfal_rnd
提出日時 2017-02-28 23:52:07
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 691 bytes
コンパイル時間 3,970 ms
コンパイル使用メモリ 77,324 KB
実行使用メモリ 55,468 KB
最終ジャッジ日時 2024-06-12 00:42:33
合計ジャッジ時間 14,495 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 209 ms
43,776 KB
testcase_09 AC 133 ms
41,200 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 130 ms
41,348 KB
testcase_16 WA -
testcase_17 AC 132 ms
41,080 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 131 ms
41,268 KB
testcase_22 AC 133 ms
41,456 KB
testcase_23 AC 134 ms
41,036 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class A{
	static Scanner s = new Scanner(System.in);
	static boolean dp[][];
	public static void main(String[] args) {
		int n=s.nextInt(),m=s.nextInt();
		dp = new boolean[n][n];
		for(int i=0;i<n;i++) dp[i][i]=true;
		for(int i=0;i<m;i++) {
			int a=s.nextInt(),b=s.nextInt();
			dp[a][b]=true;
			dp[b][a]=true;
		}

		int result=0;
		for(int i=0;i<n;i++) {
			for(int j=0;j<n;j++) {
				if(dp[i][j])
				for(int k=0;k<n;k++) {
					if(dp[j][k]&&!dp[i][k])
					for(int l=0;l<n;l++) {
						if(dp[k][l]&&dp[l][i]&&!dp[j][l]) {
							result++;
							System.out.printf("%d,%d,%d,%d\n",i,j,k,l);
						}
					}
				}
			}
		}
		System.out.println(result/8);
	}
}
0