結果

問題 No.113 宝探し
ユーザー fal_rndfal_rnd
提出日時 2017-07-18 23:52:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 115 ms / 5,000 ms
コード長 293 bytes
コンパイル時間 2,248 ms
コンパイル使用メモリ 74,900 KB
実行使用メモリ 41,436 KB
最終ジャッジ日時 2024-04-28 07:58:00
合計ジャッジ時間 5,800 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
41,060 KB
testcase_01 AC 108 ms
41,120 KB
testcase_02 AC 102 ms
40,028 KB
testcase_03 AC 94 ms
40,136 KB
testcase_04 AC 99 ms
41,160 KB
testcase_05 AC 99 ms
41,056 KB
testcase_06 AC 100 ms
40,860 KB
testcase_07 AC 107 ms
41,040 KB
testcase_08 AC 91 ms
40,172 KB
testcase_09 AC 98 ms
41,100 KB
testcase_10 AC 91 ms
39,980 KB
testcase_11 AC 109 ms
41,236 KB
testcase_12 AC 102 ms
40,932 KB
testcase_13 AC 98 ms
39,936 KB
testcase_14 AC 102 ms
41,160 KB
testcase_15 AC 109 ms
41,260 KB
testcase_16 AC 106 ms
40,884 KB
testcase_17 AC 111 ms
41,436 KB
testcase_18 AC 110 ms
40,864 KB
testcase_19 AC 94 ms
39,856 KB
testcase_20 AC 103 ms
40,448 KB
testcase_21 AC 95 ms
40,280 KB
testcase_22 AC 104 ms
41,100 KB
testcase_23 AC 100 ms
41,148 KB
testcase_24 AC 95 ms
39,796 KB
testcase_25 AC 115 ms
41,176 KB
testcase_26 AC 100 ms
40,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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