結果
| 問題 | 
                            No.113 宝探し
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2016-12-21 16:44:42 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 253 bytes | 
| コンパイル時間 | 1,623 ms | 
| コンパイル使用メモリ | 167,292 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-16 21:29:38 | 
| 合計ジャッジ時間 | 2,114 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 23 | 
コンパイルメッセージ
main.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main()
      | ^~~~
            
            ソースコード
#include<bits/stdc++.h>
using namespace std;
main()
{
	string s;cin>>s;
	int u=0,l=0;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='N')u++;
		else if(s[i]=='E')l++;
		else if(s[i]=='S')u--;
		else l--;
	}
	cout<<fixed<<setprecision(9)<<hypot(u,l)<<endl;
}