結果
問題 | No.113 宝探し |
ユーザー |
![]() |
提出日時 | 2019-11-23 12:02:48 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,034 bytes |
コンパイル時間 | 916 ms |
コンパイル使用メモリ | 112,228 KB |
実行使用メモリ | 28,820 KB |
最終ジャッジ日時 | 2024-10-11 06:51:18 |
合計ジャッジ時間 | 2,506 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | AC | 25 ms
18,304 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 24 ms
18,816 KB |
testcase_06 | AC | 25 ms
18,688 KB |
testcase_07 | AC | 24 ms
18,816 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 25 ms
18,688 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 24 ms
18,944 KB |
testcase_18 | AC | 26 ms
18,688 KB |
testcase_19 | AC | 25 ms
18,816 KB |
testcase_20 | AC | 24 ms
18,944 KB |
testcase_21 | AC | 25 ms
18,560 KB |
testcase_22 | AC | 25 ms
18,944 KB |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Text; using System.Linq; namespace ConsoleApp11 { class Program { static void Main(string[] args) { string S = Console.ReadLine(); double countN = 0; double countE = 0; double countW = 0; double countS = 0; double sum = 0; for(int i = 0; i < S.Length; i++) { if(S[i] == 'N') { countN++; } else if(S[i] == 'E') { countE++; } else if(S[i] == 'W') { countW++; } else if(S[i] == 'S') { countS++; } } sum = (countN * countN) + (countE * countE) + (countW * countW) + (countS * countS); double root = Math.Sqrt(sum); Console.WriteLine(root); } } }