結果
問題 |
No.113 宝探し
|
ユーザー |
![]() |
提出日時 | 2016-11-07 11:17:08 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 24 ms / 5,000 ms |
コード長 | 670 bytes |
コンパイル時間 | 1,169 ms |
コンパイル使用メモリ | 109,536 KB |
実行使用メモリ | 18,688 KB |
最終ジャッジ日時 | 2024-11-16 21:28:27 |
合計ジャッジ時間 | 2,935 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; class Magatro { static void Main() { string s = Console.ReadLine(); int n=0, e=0; for(int i = 0; i < s.Length; i++) { switch (s[i]) { case 'N': n++; break; case 'E': e++; break; case 'S': n--; break; case 'W': e--; break; } } Console.WriteLine(Math.Sqrt(n * n + e * e)); } }