結果

問題 No.410 出会い
ユーザー littleTrooperlittleTrooper
提出日時 2016-08-16 16:30:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 2,494 bytes
コンパイル時間 4,126 ms
コンパイル使用メモリ 81,232 KB
実行使用メモリ 56,380 KB
最終ジャッジ日時 2023-09-10 20:03:18
合計ジャッジ時間 7,281 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,940 KB
testcase_01 AC 118 ms
55,704 KB
testcase_02 AC 118 ms
55,760 KB
testcase_03 AC 117 ms
55,688 KB
testcase_04 AC 118 ms
56,016 KB
testcase_05 AC 119 ms
55,684 KB
testcase_06 AC 119 ms
55,520 KB
testcase_07 AC 120 ms
55,636 KB
testcase_08 AC 119 ms
55,768 KB
testcase_09 AC 119 ms
55,528 KB
testcase_10 AC 120 ms
55,676 KB
testcase_11 AC 122 ms
55,440 KB
testcase_12 AC 118 ms
55,844 KB
testcase_13 AC 119 ms
55,760 KB
testcase_14 AC 119 ms
55,848 KB
testcase_15 AC 119 ms
56,380 KB
testcase_16 AC 119 ms
55,528 KB
testcase_17 AC 118 ms
54,396 KB
testcase_18 AC 119 ms
55,720 KB
testcase_19 AC 118 ms
56,080 KB
testcase_20 AC 119 ms
55,608 KB
testcase_21 AC 118 ms
55,816 KB
testcase_22 AC 118 ms
55,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.util.regex.*;
import java.util.Collections;
import java.util.*;
import java.math.*;
import java.util.Stack;



public class woo_01 {
    

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


        // ArrayList<String> box = new ArrayList<String>();
        // int n = Integer.parseInt(sc.nextLine());
        // Deque<String> que = new ArrayDeque<String>();
        int[] pos_a = new int[2];
        int[] pos_b = new int[2];
        String  line = sc.nextLine();
        inSpaceDelimiterInt(line, pos_a);
        line = sc.nextLine();
        inSpaceDelimiterInt(line, pos_b);

        int delta_x = Math.abs(pos_a[0] - pos_b[0]);
        int delta_y = Math.abs(pos_a[1] - pos_b[1]);

// System.out.println("delata_x="+delta_x+" delata_y="+delta_y);
        double meet_x = (double)delta_x / 2;
        double meet_y = (double)delta_y / 2;
// System.out.println("meet_x="+meet_x+" meet_y="+meet_y);

        // if ( meet_x > meet_y )
            // System.out.println(meet_x);
        // else
            System.out.println(meet_x+meet_y);
    }
   
    private static void inSpaceDelimiterInt(String readLine, int[] box) {
		// String readLine = br.readLine();
    	readLine = readLine.trim();	
		String[] readLineArray = readLine.split(" ");
        try{
            for( int i=0; i<readLineArray.length; i++) {
                box[i] = Integer.parseInt(readLineArray[i]);
            }
		} catch (Exception e) {
            System.out.println("Illgal number");
        }		
		return ;
	}

	private static void inSpaceDelimiterString(String readLine, ArrayList<String> box) {
		// String readLine = br.readLine();
    	readLine = readLine.trim();	
		String[] readLineArray = readLine.split(" ");
        try{
            for( int i=0; i<readLineArray.length; i++) {
                box.add(readLineArray[i]);
            }
		} catch (Exception e) {
            System.out.println("Illgal number");
        }		
		return ;
	}

	private static void inSpaceDelimiterIntArrayList(String readLine, ArrayList<Integer> box) {
		// String readLine = br.readLine();
    	readLine = readLine.trim();	
		String[] readLineArray = readLine.split(" ");
        try{
            for( int i=0; i<readLineArray.length; i++) {
                box.add(Integer.parseInt(readLineArray[i]));
            }
		} catch (Exception e) {
            System.out.println("Illgal number");
        }		
		return ;
	}
}
0