結果

問題 No.306 さいたま2008
ユーザー GrenacheGrenache
提出日時 2015-11-27 23:04:06
言語 Java19
(openjdk 21)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 1,699 bytes
コンパイル時間 3,427 ms
コンパイル使用メモリ 75,272 KB
実行使用メモリ 56,128 KB
最終ジャッジ日時 2023-10-12 00:29:56
合計ジャッジ時間 7,035 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
55,772 KB
testcase_01 AC 109 ms
55,948 KB
testcase_02 AC 109 ms
55,288 KB
testcase_03 AC 110 ms
55,752 KB
testcase_04 AC 109 ms
55,768 KB
testcase_05 AC 108 ms
55,892 KB
testcase_06 AC 108 ms
55,720 KB
testcase_07 AC 108 ms
55,624 KB
testcase_08 AC 107 ms
55,408 KB
testcase_09 AC 108 ms
55,724 KB
testcase_10 AC 107 ms
55,716 KB
testcase_11 AC 107 ms
56,128 KB
testcase_12 AC 112 ms
55,828 KB
testcase_13 AC 111 ms
56,032 KB
testcase_14 AC 109 ms
55,520 KB
testcase_15 AC 108 ms
55,832 KB
testcase_16 AC 109 ms
55,920 KB
testcase_17 AC 108 ms
55,900 KB
testcase_18 AC 111 ms
55,512 KB
testcase_19 AC 110 ms
55,828 KB
testcase_20 AC 111 ms
56,092 KB
testcase_21 AC 108 ms
56,028 KB
testcase_22 AC 108 ms
55,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Iterator;


public class Main_yukicoder306 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Printer pr = new Printer(System.out);

        int xa = sc.nextInt();
        int ya = sc.nextInt();
        int xb = sc.nextInt();
        int yb = sc.nextInt();

        double y = (double)(yb - ya) / (xb + xa) * (-xb) + yb;

        pr.printf("%.7f\n", y);

        pr.close();
        sc.close();
    }

	@SuppressWarnings("unused")
	private static class Scanner {
		BufferedReader br;
		Iterator<String> it;

		Scanner (InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}

		String next() throws RuntimeException  {
			try {
				if (it == null || !it.hasNext()) {
					it = Arrays.asList(br.readLine().split(" ")).iterator();
				}
				return it.next();
			} catch (IOException e) {
				throw new IllegalStateException();
			}
		}

		int nextInt() throws RuntimeException {
			return Integer.parseInt(next());
		}

		long nextLong() throws RuntimeException {
			return Long.parseLong(next());
		}

		float nextFloat() throws RuntimeException {
			return Float.parseFloat(next());
		}

		double nextDouble() throws RuntimeException {
			return Double.parseDouble(next());
		}

		void close() {
			try {
				br.close();
			} catch (IOException e) {
//				throw new IllegalStateException();
			}
		}
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0