結果
| 問題 | No.113 宝探し |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-13 14:42:41 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 17 ms / 5,000 ms |
| + 258µs | |
| コード長 | 370 bytes |
| 記録 | |
| コンパイル時間 | 1,655 ms |
| コンパイル使用メモリ | 114,572 KB |
| 実行使用メモリ | 27,532 KB |
| 最終ジャッジ日時 | 2026-09-25 01:17:30 |
| 合計ジャッジ時間 | 4,035 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
public class Program {
public static void Main(string[] args) {
char[] c = Console.ReadLine().ToCharArray();
int x = 0;
int y = 0;
for (int i = 0; i < c.Length; i++) {
switch(c[i]) {
case 'N': y++; break;
case 'W': x++; break;
case 'E': x--; break;
case 'S': y--; break;
}
}
Console.WriteLine(Math.Sqrt(x*x + y*y));
}
}