結果
問題 |
No.113 宝探し
|
ユーザー |
👑 |
提出日時 | 2020-01-08 15:34:12 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 388 bytes |
コンパイル時間 | 657 ms |
コンパイル使用メモリ | 74,300 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 22:25:31 |
合計ジャッジ時間 | 1,469 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
ソースコード
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int a[2]; int main(){ string s;cin>>s; cout << fixed << setprecision(10); for(int i = 0; s.size() > i; i++){ if(s[i] == 'N')a[0]++; else if(s[i] == 'S')a[0]--; else if(s[i] == 'E')a[1]++; else a[1]--; } cout << (double)sqrt((a[0]*a[0])+(a[1]*a[1])) << endl; }