結果
| 問題 | No.113 宝探し |
| コンテスト | |
| ユーザー |
mayoko_
|
| 提出日時 | 2014-12-28 23:22:57 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 660 bytes |
| 記録 | |
| コンパイル時間 | 493 ms |
| コンパイル使用メモリ | 96,252 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-12 02:01:20 |
| 合計ジャッジ時間 | 1,479 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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_