結果

問題 No.113 宝探し
ユーザー chacoder1
提出日時 2020-12-20 22:52:44
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 325 bytes
コンパイル時間 1,947 ms
コンパイル使用メモリ 192,328 KB
最終ジャッジ日時 2025-01-17 05:04:57
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

char koma[10][10];
        
int main(){
  string S;
  cin>>S;
  double x=0;
  double y=0;
  for(int i=0;i<S.length();i++){
    if(S.at(i)=='N') x++;
    if(S.at(i)=='S') x--;
    if(S.at(i)=='E') y++;
    if(S.at(i)=='W') y--;
  }
  cout<<pow(y*y+x*x,0.5)<<endl;
  return 0;
}

0