結果
問題 |
No.113 宝探し
|
ユーザー |
![]() |
提出日時 | 2015-01-28 21:32:45 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 285 bytes |
コンパイル時間 | 394 ms |
コンパイル使用メモリ | 59,220 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 20:40:29 |
合計ジャッジ時間 | 1,108 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
ソースコード
#include <iostream> #include <string> #include <cmath> using namespace std; int main() { int x[128]={}, y[128]={}; y['N']=1, y['S']=-1; x['W']=1, x['E']=-1; string s; cin>>s; int a=0, b=0; for(char c: s) { a+=x[c]; b+=y[c]; } cout<<hypot(a, b)<<endl; }