結果
問題 |
No.113 宝探し
|
ユーザー |
|
提出日時 | 2019-09-06 08:37:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 1,671 ms |
コンパイル使用メモリ | 170,072 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 22:10:36 |
合計ジャッジ時間 | 2,586 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
ソースコード
/** @file 113.cpp @title No.113 宝探し - yukicoder @url https://yukicoder.me/problems/no/113 **/ #include <bits/stdc++.h> using namespace std; typedef long long LL; #define ALL(obj) (obj).begin(), (obj).end() #define REP(i, N) for (int i = 0; i < (N); ++i) int main() { string inS; cin >> inS; sort(ALL(inS)); int N = count(ALL(inS), 'N'); int E = count(ALL(inS), 'E'); int W = count(ALL(inS), 'W'); int S = count(ALL(inS), 'S'); cout << (double)sqrt((N - S) * (N - S) + (W - E) * (W - E)) << endl; return 0; }