結果
問題 |
No.113 宝探し
|
ユーザー |
![]() |
提出日時 | 2016-09-26 02:33:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 416 bytes |
コンパイル時間 | 1,462 ms |
コンパイル使用メモリ | 167,248 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 21:27:19 |
合計ジャッジ時間 | 2,211 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; int main() { string str; cin >> str; auto N = count( str.begin(), str.end(), 'N' ); auto E = count( str.begin(), str.end(), 'E' ); auto W = count( str.begin(), str.end(), 'W' ); auto S = count( str.begin(), str.end(), 'S' ); cout << sqrt( pow( N - S, 2 ) + pow( E - W, 2 ) ) << endl; return 0; }