結果

問題 No.1806 Rotating Golem
ユーザー soragsorag
提出日時 2022-07-26 21:49:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 667 bytes
コンパイル時間 514 ms
コンパイル使用メモリ 68,520 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-16 11:51:48
合計ジャッジ時間 1,209 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<map>
using namespace std;
int main() {
	int n=0;
	char a,b;
	cin >> a;
	cin >> b;
	if (a == 'E') {
		if (b == 'E') n = 0;
		else if (b == 'S') n = 1;
		else if (b == 'W') n = 2;
		else if (b == 'N') n = 3;
	}
	if (a == 'S') {
		if (b == 'S') n = 0;
		else if (b == 'W') n = 1;
		else if (b == 'N') n = 2;
		else if (b == 'E') n = 3;
	}
	if (a == 'W') {
		if (b == 'W') n = 0;
		else if (b == 'N') n = 1;
		else if (b == 'E') n = 2;
		else if (b == 'S') n = 3;
	}
	if (a == 'N') {
		if (b == 'N') n = 0;
		else if (b == 'E') n = 1;
		else if (b == 'S') n = 2;
		else if (b == 'W') n = 3;
	}
	cout << n << endl;
	return 0;
}
0