結果
| 問題 |
No.113 宝探し
|
| コンテスト | |
| ユーザー |
mayoko_
|
| 提出日時 | 2014-12-28 23:22:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 660 bytes |
| コンパイル時間 | 809 ms |
| コンパイル使用メモリ | 74,320 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-16 20:32:36 |
| 合計ジャッジ時間 | 1,540 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 23 |
ソースコード
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#define INF 1000000000
using namespace std;
typedef long long ll;
int main(void) {
int tate = 0, yoko = 0;
string s;
cin >> s;
for (int i =0; i < s.size(); i++) {
if (s[i] == 'N') tate++;
if (s[i] == 'S') tate--;
if (s[i] == 'E') yoko++;
if (s[i] == 'W') yoko--;
}
double ret = sqrt(tate*tate+yoko*yoko);
printf("%.10lf\n", ret);
return 0;
}
mayoko_