結果
| 問題 | No.112 ややこしい鶴亀算 |
| コンテスト | |
| ユーザー |
nkhrlab
|
| 提出日時 | 2018-07-12 03:52:54 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 51 ms / 5,000 ms |
| + 232µs | |
| コード長 | 668 bytes |
| 記録 | |
| コンパイル時間 | 1,315 ms |
| コンパイル使用メモリ | 84,072 KB |
| 実行使用メモリ | 42,496 KB |
| 最終ジャッジ日時 | 2026-09-02 13:38:48 |
| 合計ジャッジ時間 | 4,493 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
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);
}
}
nkhrlab