結果

問題 No.410 出会い
ユーザー Grenache
提出日時 2016-08-12 22:23:27
言語 Java8
(openjdk 1.8.0.222)
結果
AC  
実行時間 84 ms
コード長 1,585 Byte
コンパイル時間 2,398 ms
使用メモリ 32,768 KB
最終ジャッジ日時 2019-09-09 11:06:40

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
99_system_test1.txt AC 82 ms
32,288 KB
99_system_test2.txt AC 84 ms
31,680 KB
99_system_test3.txt AC 84 ms
30,968 KB
99_system_test4.txt AC 83 ms
31,484 KB
99_system_test5.txt AC 82 ms
31,996 KB
99_system_test6.txt AC 81 ms
29,144 KB
99_system_test7.txt AC 83 ms
32,116 KB
99_system_test8.txt AC 82 ms
32,116 KB
99_system_test9.txt AC 80 ms
30,864 KB
99_system_test10.txt AC 82 ms
31,796 KB
99_system_test11.txt AC 83 ms
31,276 KB
sample1.txt AC 84 ms
30,860 KB
sample2.txt AC 82 ms
31,080 KB
sample3.txt AC 83 ms
31,416 KB
sample4.txt AC 81 ms
29,488 KB
test1.txt AC 82 ms
31,840 KB
test2.txt AC 81 ms
30,952 KB
test3.txt AC 83 ms
31,016 KB
test4.txt AC 82 ms
31,680 KB
test5.txt AC 82 ms
32,768 KB
test6.txt AC 82 ms
31,764 KB
test7.txt AC 82 ms
30,864 KB
test8.txt AC 83 ms
30,456 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