結果
| 問題 |
No.1806 Rotating Golem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-14 21:36:27 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 559 bytes |
| コンパイル時間 | 840 ms |
| コンパイル使用メモリ | 76,784 KB |
| 最終ジャッジ日時 | 2025-01-27 11:06:03 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0;i < (int)(n);i++)
void slove(){
char a,b;
cin >> a >> b;
int ans = 0;
if (b == 'E') ans = 1;
else if (b == 'S') ans = 2;
else if (b == 'W') ans = 3;
if (a == 'E') ans -= 1;
else if (a == 'S') ans -=2;
else if (a == 'W') ans -=3;
cout << (ans+4)%4 << endl;
}
int main(){
int tt = 1;
//cin >> tt;
while(tt--){
slove();
}
return 0;
}