結果

問題 No.360 増加門松列
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-06-18 23:59:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 3,670 ms
コンパイル使用メモリ 73,340 KB
実行使用メモリ 58,220 KB
最終ジャッジ日時 2023-09-13 06:59:24
合計ジャッジ時間 7,058 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,756 KB
testcase_01 AC 120 ms
56,328 KB
testcase_02 AC 120 ms
55,992 KB
testcase_03 AC 121 ms
56,072 KB
testcase_04 AC 119 ms
55,708 KB
testcase_05 AC 120 ms
56,032 KB
testcase_06 AC 121 ms
55,700 KB
testcase_07 AC 121 ms
56,308 KB
testcase_08 AC 120 ms
58,220 KB
testcase_09 AC 120 ms
56,268 KB
testcase_10 AC 120 ms
55,768 KB
testcase_11 AC 122 ms
56,060 KB
testcase_12 AC 120 ms
55,852 KB
testcase_13 AC 120 ms
55,804 KB
testcase_14 AC 121 ms
56,056 KB
testcase_15 AC 120 ms
55,776 KB
testcase_16 AC 121 ms
56,088 KB
testcase_17 AC 119 ms
55,864 KB
testcase_18 AC 120 ms
56,200 KB
testcase_19 AC 119 ms
56,044 KB
testcase_20 AC 120 ms
55,756 KB
testcase_21 AC 120 ms
56,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class No360{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int[] D = new int[7];
		for(int i = 0; i < 7; i++){
			D[i] = sc.nextInt();
		}
		boolean ans = true;
		Arrays.sort(D);
		for(int i = 1; i < 6; i++){
			if(D[i] == D[i-1] && D[i] == D[i+1]) ans = false;
		}
		if(D[0] == D[1] || D[5] == D[6]) ans = false;
		if(D[1] == D[2] && D[4] == D[5]) ans = false;
		
		System.out.println(ans ? "YES": "NO");
	}
}
0