結果

問題 No.112 ややこしい鶴亀算
ユーザー nkhrlabnkhrlab
提出日時 2018-07-12 03:52:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 668 bytes
コンパイル時間 2,283 ms
コンパイル使用メモリ 74,984 KB
実行使用メモリ 57,508 KB
最終ジャッジ日時 2023-10-23 21:45:46
合計ジャッジ時間 6,522 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
57,396 KB
testcase_01 AC 117 ms
57,156 KB
testcase_02 AC 117 ms
57,488 KB
testcase_03 AC 118 ms
57,164 KB
testcase_04 AC 116 ms
57,208 KB
testcase_05 AC 115 ms
57,188 KB
testcase_06 AC 114 ms
57,200 KB
testcase_07 AC 113 ms
57,004 KB
testcase_08 AC 117 ms
57,440 KB
testcase_09 AC 115 ms
57,316 KB
testcase_10 AC 117 ms
57,176 KB
testcase_11 AC 112 ms
57,128 KB
testcase_12 AC 117 ms
57,312 KB
testcase_13 AC 117 ms
57,212 KB
testcase_14 AC 120 ms
57,436 KB
testcase_15 AC 119 ms
57,276 KB
testcase_16 AC 120 ms
57,444 KB
testcase_17 AC 119 ms
57,508 KB
testcase_18 AC 119 ms
57,140 KB
testcase_19 AC 119 ms
56,872 KB
testcase_20 AC 117 ms
55,692 KB
testcase_21 AC 118 ms
57,076 KB
testcase_22 AC 123 ms
57,412 KB
testcase_23 AC 121 ms
57,036 KB
testcase_24 AC 120 ms
57,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s = r.readLine();
    int n = Integer.parseInt(s);
    int a[] = new int[100];
    s = r.readLine();
    String[] sl = s.split(" ");

    for(int i = 0; i < n; i++)
    {
      a[i] = Integer.parseInt(sl[i]);
    }
    
    int k = 0;
    
    for(int i = 0; i < n; i++)
    {
      k += a[i];
    }
    k /= n - 1;
    
    System.out.printf("%d %d", (4 * n - k) / 2, n - (4 * n - k) / 2);

  }

}
0