結果

問題 No.112 ややこしい鶴亀算
ユーザー dazydazy
提出日時 2016-09-13 03:24:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 462 bytes
コンパイル時間 3,729 ms
コンパイル使用メモリ 75,016 KB
実行使用メモリ 41,608 KB
最終ジャッジ日時 2024-04-28 12:41:44
合計ジャッジ時間 7,165 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
41,344 KB
testcase_01 AC 106 ms
41,316 KB
testcase_02 AC 110 ms
41,608 KB
testcase_03 AC 101 ms
40,468 KB
testcase_04 AC 108 ms
41,028 KB
testcase_05 AC 106 ms
40,892 KB
testcase_06 AC 116 ms
41,328 KB
testcase_07 WA -
testcase_08 AC 115 ms
41,160 KB
testcase_09 AC 110 ms
41,128 KB
testcase_10 AC 99 ms
40,380 KB
testcase_11 AC 108 ms
41,072 KB
testcase_12 AC 110 ms
41,388 KB
testcase_13 AC 111 ms
41,308 KB
testcase_14 AC 102 ms
39,952 KB
testcase_15 AC 111 ms
40,800 KB
testcase_16 AC 118 ms
41,376 KB
testcase_17 WA -
testcase_18 AC 118 ms
41,096 KB
testcase_19 AC 117 ms
41,280 KB
testcase_20 AC 125 ms
41,048 KB
testcase_21 AC 118 ms
41,144 KB
testcase_22 AC 124 ms
41,112 KB
testcase_23 AC 110 ms
40,088 KB
testcase_24 AC 108 ms
40,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int a = scan.nextInt();
        int x = 1;
        int b;
        for (int i = 0; i < N - 1; i++) {
            b = scan.nextInt();
            if (b == a) x++;
        }
        if (x*2 + (N-x)*4 - 2 == a) {}
        else x = N - x;
        System.out.printf("%d %d",x,N-x);
    }
}
0