結果

問題 No.113 宝探し
ユーザー fal_rndfal_rnd
提出日時 2017-07-18 23:55:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 108 ms / 5,000 ms
コード長 254 bytes
コンパイル時間 1,692 ms
コンパイル使用メモリ 74,980 KB
実行使用メモリ 41,092 KB
最終ジャッジ日時 2024-04-28 07:58:08
合計ジャッジ時間 5,220 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
40,240 KB
testcase_01 AC 95 ms
39,956 KB
testcase_02 AC 92 ms
40,040 KB
testcase_03 AC 102 ms
40,124 KB
testcase_04 AC 103 ms
40,080 KB
testcase_05 AC 101 ms
40,936 KB
testcase_06 AC 105 ms
41,044 KB
testcase_07 AC 102 ms
40,892 KB
testcase_08 AC 103 ms
40,732 KB
testcase_09 AC 105 ms
39,964 KB
testcase_10 AC 103 ms
40,928 KB
testcase_11 AC 91 ms
39,964 KB
testcase_12 AC 87 ms
39,904 KB
testcase_13 AC 101 ms
40,980 KB
testcase_14 AC 103 ms
40,880 KB
testcase_15 AC 106 ms
40,984 KB
testcase_16 AC 102 ms
40,140 KB
testcase_17 AC 108 ms
40,824 KB
testcase_18 AC 93 ms
40,032 KB
testcase_19 AC 105 ms
40,976 KB
testcase_20 AC 104 ms
41,008 KB
testcase_21 AC 95 ms
39,836 KB
testcase_22 AC 107 ms
40,832 KB
testcase_23 AC 102 ms
40,832 KB
testcase_24 AC 107 ms
41,092 KB
testcase_25 AC 102 ms
41,084 KB
testcase_26 AC 103 ms
41,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

class C{
	public static void main(String[]$){
		int x=0,y=0;
		for(char c:new java.util.Scanner(System.in).next().toCharArray()) {
			if(c=='N')++y;
			if(c=='E')++x;
			if(c=='W')--x;
			if(c=='S')--y;
		}
		System.out.println(Math.sqrt(x*x+y*y));
	}
}
0