結果
| 問題 | No.113 宝探し |
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2020-03-19 12:03:12 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 451µs | |
| コード長 | 349 bytes |
| 記録 | |
| コンパイル時間 | 846 ms |
| コンパイル使用メモリ | 183,728 KB |
| 実行使用メモリ | 9,916 KB |
| 最終ジャッジ日時 | 2026-09-25 01:54:36 |
| 合計ジャッジ時間 | 2,564 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
string S;
cin >> S;
int x = 0;
int y = 0;
for( int i = 0; i < S.size(); i++ ) {
if( S[i] == 'N' ) y++;
else if( S[i] == 'E' ) x++;
else if( S[i] == 'W' ) x--;
else y--;
}
double ans = sqrt( (double)( x * x + y * y ) );
cout << fixed << setprecision(12) << ans << endl;
}
forest3