結果

問題 No.113 宝探し
ユーザー fura
提出日時 2020-03-14 03:59:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 263 bytes
コンパイル時間 2,113 ms
コンパイル使用メモリ 193,448 KB
最終ジャッジ日時 2025-01-09 06:45:42
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	string s; cin>>s;
	int x=0,y=0;
	for(char c:s){
		if(c=='N') y++;
		if(c=='E') x++;
		if(c=='W') x--;
		if(c=='S') y--;
	}
	cout<<hypot(x,y)<<'\n';
	return 0;
}
0