結果

問題 No.112 ややこしい鶴亀算
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-12 07:37:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 155 ms / 5,000 ms
コード長 421 bytes
コンパイル時間 2,397 ms
コンパイル使用メモリ 74,120 KB
実行使用メモリ 57,184 KB
最終ジャッジ日時 2023-08-17 02:22:47
合計ジャッジ時間 7,212 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 147 ms
56,584 KB
testcase_01 AC 146 ms
57,184 KB
testcase_02 AC 145 ms
56,764 KB
testcase_03 AC 154 ms
56,720 KB
testcase_04 AC 148 ms
56,756 KB
testcase_05 AC 145 ms
54,556 KB
testcase_06 AC 144 ms
56,952 KB
testcase_07 AC 145 ms
56,840 KB
testcase_08 AC 143 ms
56,836 KB
testcase_09 AC 144 ms
56,592 KB
testcase_10 AC 145 ms
56,792 KB
testcase_11 AC 144 ms
57,108 KB
testcase_12 AC 146 ms
56,908 KB
testcase_13 AC 145 ms
56,592 KB
testcase_14 AC 149 ms
56,728 KB
testcase_15 AC 149 ms
56,944 KB
testcase_16 AC 151 ms
56,736 KB
testcase_17 AC 150 ms
56,740 KB
testcase_18 AC 154 ms
57,104 KB
testcase_19 AC 155 ms
56,824 KB
testcase_20 AC 151 ms
56,852 KB
testcase_21 AC 153 ms
57,108 KB
testcase_22 AC 154 ms
57,100 KB
testcase_23 AC 154 ms
56,768 KB
testcase_24 AC 152 ms
56,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int Fsum = 0;
        for(int i=0; i<N; i++){
            int temp = sc.nextInt();
            Fsum = Fsum + temp;
        }
        int Tsum = Fsum/(N-1);
        int c = (4*N-Tsum)/2;
        int t = N-c;
        System.out.println(c+ " "+t);
    }
}
0