結果

問題 No.1806 Rotating Golem
ユーザー matcharate12matcharate12
提出日時 2022-03-13 16:55:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 504 bytes
コンパイル時間 1,522 ms
コンパイル使用メモリ 165,860 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-19 03:54:51
合計ジャッジ時間 2,783 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,348 KB
testcase_13 WA -
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define srep(i,a,b) for(int i = a; i < b; i++)
#define all(A) (A).begin(),A.end()
#define MOD 1000000007
using namespace std;
using ll = long long;
using P = pair<char,int>;
using Graph = vector<vector<int>>;

int ch_int(char x){
	if(x == 'E') return 1;
	else if(x == 'W') return 3;
	else if(x == 'S') return 2;
	else return 4;
}

int main(void){
	char a,b; cin >> a >> b;
	int ai = ch_int(a),bi = ch_int(b);

	cout << abs(ai-bi);

}

0