結果
| 問題 | No.113 宝探し |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-17 13:41:06 |
| 言語 | C (gcc 15.3.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 0 ms / 5,000 ms |
| + 776µs | |
| コード長 | 379 bytes |
| 記録 | |
| コンパイル時間 | 1,587 ms |
| コンパイル使用メモリ | 43,264 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-09-17 13:41:09 |
| 合計ジャッジ時間 | 3,445 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 23 |
ソースコード
#include <stdio.h>
#include <string.h>
#include <math.h>
int main(void)
{
char str[101];
int n = 0, e = 0, w = 0, s = 0;
int i;
scanf("%s", str);
for (i = 0; i < strlen(str); i++) {
if (str[i] == 'N')
n++;
else if (str[i] == 'E')
e++;
else if (str[i] == 'W')
w++;
else
s++;
}
n -= s;
e -= w;
printf("%.5f\n", sqrt(n * n + e * e));
return 0;
}