結果
| 問題 |
No.113 宝探し
|
| コンテスト | |
| ユーザー |
hamray
|
| 提出日時 | 2017-11-17 00:06:35 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 471 bytes |
| コンパイル時間 | 584 ms |
| コンパイル使用メモリ | 74,632 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-16 21:40:13 |
| 合計ジャッジ時間 | 1,284 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 23 |
ソースコード
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<algorithm>
#include<vector>
#include<math.h>
#include<stack>
using namespace std;
int main(void){
string S; cin >> S;
int H = 0, W = 0;
for(int i = 0; i < S.size(); i++){
if(S[i] == 'N') H += 1;
if(S[i] == 'S') H -= 1;
if(S[i] == 'W') W -= 1;
if(S[i] == 'E') W += 1;
}
cout << fixed << pow(H * H + W * W, 1.0 / 2.0) << endl;
return 0;
}
hamray