結果

問題 No.112 ややこしい鶴亀算
ユーザー KinoshitaKinoshita
提出日時 2015-09-19 17:24:11
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 594 bytes
コンパイル時間 2,497 ms
コンパイル使用メモリ 74,612 KB
実行使用メモリ 57,260 KB
最終ジャッジ日時 2023-09-26 13:45:49
合計ジャッジ時間 7,753 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 161 ms
56,980 KB
testcase_01 AC 159 ms
56,472 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 159 ms
56,680 KB
testcase_05 AC 157 ms
57,260 KB
testcase_06 AC 158 ms
56,504 KB
testcase_07 WA -
testcase_08 AC 157 ms
56,604 KB
testcase_09 AC 157 ms
57,240 KB
testcase_10 AC 157 ms
56,704 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 160 ms
56,716 KB
testcase_14 AC 166 ms
57,136 KB
testcase_15 AC 170 ms
57,028 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 167 ms
56,980 KB
testcase_20 AC 166 ms
56,964 KB
testcase_21 AC 167 ms
57,032 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 164 ms
56,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int[] n = new int[sc.nextInt()];
		int turu = 0, kame = 0;
		
		for(int i = 0; i < n.length; i++)
			n[i] = sc.nextInt();
		
		Arrays.sort(n);
		
		if(n[0] != n[1]){
			if(n[0] == 2){
				kame = n.length - 1;
				turu = 1;
			}
			else{
				turu = n.length - 1;
				kame = 1;
			}	
		}
		else{
			if(n[0] / (n.length - 1) == 2)turu = n.length;
			else kame = n.length;
		}
		
		System.out.println(turu + " " + kame);
		
		sc.close();
	}
}
0