結果
問題 | No.113 宝探し |
ユーザー | Shawn stayC |
提出日時 | 2020-05-26 21:27:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 331 bytes |
コンパイル時間 | 1,482 ms |
コンパイル使用メモリ | 168,012 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-13 03:01:22 |
合計ジャッジ時間 | 2,251 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0; i<(n); i++) using namespace std; typedef long long ll; int main(){ string d; cin>>d; int n,s,w,e; n=s=w=e=0; for(char x:d){ if(x=='N') n++; else if(x=='S') s++; else if(x=='W') w++; else if(x=='E') e++; } cout << (double)sqrt(pow(n-s,2)+pow(w-e,2)) << endl; }