結果
問題 |
No.113 宝探し
|
ユーザー |
|
提出日時 | 2015-04-05 15:18:09 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 395 bytes |
コンパイル時間 | 504 ms |
コンパイル使用メモリ | 63,700 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 20:42:33 |
合計ジャッジ時間 | 1,227 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
ソースコード
#include <iostream> #include <algorithm> #include <string> #include <cmath> using namespace std; int main() { string s; cin >> s; int nn = count(s.begin(), s.end(), 'N'); int ne = count(s.begin(), s.end(), 'E'); int ns = count(s.begin(), s.end(), 'S'); int nw = count(s.begin(), s.end(), 'W'); double ans = sqrt(pow(nn - ns, 2) + pow(ne - nw, 2)); cout << ans << endl; return 0; }