結果

問題 No.410 出会い
ユーザー Grenache
提出日時 2016-08-12 22:23:27
言語 Java8
(openjdk 1.8.0.191)
結果
AC  
実行時間 95 ms
コード長 1,585 Byte
コンパイル時間 2,529 ms
使用メモリ 29,628 KB
最終ジャッジ日時 2019-06-27 19:18:57

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
99_system_test1.txt AC 81 ms
26,776 KB
99_system_test2.txt AC 83 ms
27,196 KB
99_system_test3.txt AC 82 ms
26,824 KB
99_system_test4.txt AC 82 ms
26,772 KB
99_system_test5.txt AC 82 ms
27,692 KB
99_system_test6.txt AC 84 ms
28,820 KB
99_system_test7.txt AC 82 ms
27,168 KB
99_system_test8.txt AC 95 ms
28,456 KB
99_system_test9.txt AC 85 ms
26,752 KB
99_system_test10.txt AC 85 ms
28,824 KB
99_system_test11.txt AC 85 ms
27,528 KB
sample1.txt AC 84 ms
29,628 KB
sample2.txt AC 82 ms
27,804 KB
sample3.txt AC 83 ms
26,772 KB
sample4.txt AC 81 ms
26,772 KB
test1.txt AC 83 ms
26,776 KB
test2.txt AC 83 ms
27,200 KB
test3.txt AC 87 ms
27,196 KB
test4.txt AC 82 ms
27,332 KB
test5.txt AC 82 ms
27,876 KB
test6.txt AC 84 ms
26,776 KB
test7.txt AC 81 ms
26,776 KB
test8.txt AC 80 ms
27,756 KB
テストケース一括ダウンロード

ソースコード

diff #
import java.io.*;
import java.util.*;


public class Main_yukicoder410 {

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

    	int px = sc.nextInt();
    	int py = sc.nextInt();
    	int qx = sc.nextInt();
    	int qy = sc.nextInt();

    	double tmp = (double)(Math.abs(px - qx)) / 2 + (double)(Math.abs(py - qy)) / 2;

    	pr.println(tmp);

        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();
					it = Arrays.asList(br.readLine().split("\\p{javaWhitespace}+")).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