結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
41,052 KB
testcase_01 AC 140 ms
41,212 KB
testcase_02 AC 138 ms
41,016 KB
testcase_03 AC 139 ms
41,252 KB
testcase_04 AC 135 ms
41,264 KB
testcase_05 AC 139 ms
41,268 KB
testcase_06 AC 138 ms
41,296 KB
testcase_07 WA -
testcase_08 AC 135 ms
41,444 KB
testcase_09 AC 136 ms
41,316 KB
testcase_10 AC 136 ms
41,260 KB
testcase_11 AC 137 ms
41,748 KB
testcase_12 AC 138 ms
41,580 KB
testcase_13 AC 137 ms
41,096 KB
testcase_14 AC 143 ms
41,228 KB
testcase_15 AC 142 ms
41,436 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 140 ms
41,428 KB
testcase_21 AC 140 ms
41,192 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextByte();
        int a = scan.nextByte();
        int x = 1;
        int b;
        for (int i = 0; i < N - 1; i++) {
            b = scan.nextByte();
            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