結果
| 問題 |
No.113 宝探し
|
| コンテスト | |
| ユーザー |
Kaz_nl
|
| 提出日時 | 2017-08-20 14:35:59 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 295 bytes |
| コンパイル時間 | 554 ms |
| コンパイル使用メモリ | 59,900 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-16 21:36:09 |
| 合計ジャッジ時間 | 1,487 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 23 |
ソースコード
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int x, y;
string s;
int main() {
cin >> s;
for (auto& e : s) {
if (e == 'N') y++;
else if (e == 'E') x++;
else if (e == 'W') x--;
else if (e == 'S') y--;
}
cout << sqrt(x * x + y * y) << endl;
}
Kaz_nl