結果
| 問題 |
No.112 ややこしい鶴亀算
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-05-05 11:07:01 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 698 bytes |
| コンパイル時間 | 2,061 ms |
| コンパイル使用メモリ | 82,932 KB |
| 実行使用メモリ | 55,240 KB |
| 最終ジャッジ日時 | 2024-10-05 09:29:17 |
| 合計ジャッジ時間 | 6,394 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 23 |
ソースコード
package jp.fedom.challange.yuki.q112;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
List<String> input = new ArrayList<>();
while (sc.hasNext()) {
input.add(sc.nextLine());
}
System.out.println(solve(input));
sc.close();
}
public static String solve(List<String> in) {
int N = Integer.valueOf(in.get(0).split(" ")[0]);
int t = 0;
for (String s : in.get(1).split(" ")) {
t += Integer.valueOf(s);
}
System.out.println(t);
int kame = (t - ((N - 1) * N * 2)) / (2 * (N - 1));
int tsuru = N - kame;
return tsuru + " " + kame;
}
}