結果

問題 No.113 宝探し
ユーザー ki_ki33ki_ki33
提出日時 2014-12-28 23:28:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 1,358 bytes
コンパイル時間 2,203 ms
コンパイル使用メモリ 73,108 KB
実行使用メモリ 56,368 KB
最終ジャッジ日時 2023-08-10 14:03:59
合計ジャッジ時間 6,863 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
55,616 KB
testcase_01 AC 113 ms
55,688 KB
testcase_02 AC 109 ms
55,912 KB
testcase_03 AC 111 ms
55,928 KB
testcase_04 AC 110 ms
55,592 KB
testcase_05 AC 112 ms
55,948 KB
testcase_06 AC 110 ms
55,356 KB
testcase_07 AC 114 ms
55,872 KB
testcase_08 AC 112 ms
55,932 KB
testcase_09 AC 116 ms
55,916 KB
testcase_10 AC 113 ms
55,784 KB
testcase_11 AC 115 ms
55,668 KB
testcase_12 AC 114 ms
55,712 KB
testcase_13 AC 115 ms
56,020 KB
testcase_14 AC 111 ms
55,608 KB
testcase_15 AC 113 ms
55,952 KB
testcase_16 AC 115 ms
55,712 KB
testcase_17 AC 117 ms
55,932 KB
testcase_18 AC 109 ms
55,936 KB
testcase_19 AC 112 ms
56,368 KB
testcase_20 AC 114 ms
56,312 KB
testcase_21 AC 117 ms
55,772 KB
testcase_22 AC 115 ms
55,608 KB
testcase_23 AC 113 ms
56,212 KB
testcase_24 AC 111 ms
56,216 KB
testcase_25 AC 110 ms
53,796 KB
testcase_26 AC 111 ms
55,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedInputStream;
import java.io.IOException;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;

public class Main {
	public static final int C =  1000000007;
	//static int map[][];
	static int N;
	//static int M;
	//static int tic[][];
	//static int dp[][];
	//static int max;
	static int B[];
	//static int p[];
	//static ArrayList<HashSet<Integer>> al;
	static ArrayList<Integer> al;
	//static int a[][];
	//static char[][] ch;
	//static ArrayList<HashMap<Long, Long>> al;
	//static String a[];
	//static String str;
	//static int[] mach = new int[] {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};

	public static void main(String[] args) {
		//StringBuilder sb = new StringBuilder();
		BufferedInputStream bs = new BufferedInputStream(System.in);
		Scanner sc = new Scanner(bs);
		//String str = sc.next();



		String str = sc.next();

		
		
		double ans = 0;
		double w = 0;
		double h = 0;
		for (int i=0; i < str.length(); i++) {
			switch(str.charAt(i)) {
			case 'N':
				h++;
				break;
			case 'S':
				h--;
				break;
			case 'E':
				w++;
				break;
			case 'W':
				w--;
				break;
			}
		}
		ans = Math.hypot(h, w);
		
	
			
		System.out.println(ans);

		/*if (ans) {
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}*/

	}




}
0