結果

問題 No.113 宝探し
ユーザー gotutiyan
提出日時 2017-10-06 21:54:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 465 bytes
コンパイル時間 637 ms
コンパイル使用メモリ 82,292 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 00:33:32
合計ジャッジ時間 1,446 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <cmath>
using namespace std;

int main() {
	char c;
	double x=0, y=0;
	while (cin>>c) {
		if (c == 'N')x++;
		else if (c == 'S') x--;
		else if (c == 'E')y++;
		else if (c == 'W')y--;

		cout << c << endl << x << endl << y << endl << endl;
	}
	printf("%f\n", sqrt(x*x + y*y));
}
0