結果

問題 No.538 N.G.S.
ユーザー OlderInvestor
提出日時 2017-10-08 17:07:27
言語 Java
(openjdk 23)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 3,513 ms
コンパイル使用メモリ 73,880 KB
実行使用メモリ 54,404 KB
最終ジャッジ日時 2024-09-25 00:28:21
合計ジャッジ時間 12,450 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class No538 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] b = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        double r, d, keisu;

        keisu = 1.0 / (b[1] - b[0]);
        r = keisu * b[2] + -keisu * b[1];
        d = keisu * -b[0] * b[2] + keisu * b[1] * b[1];

        System.out.println((long)Math.round(r * b[2] + d));
    }
}
0