結果

問題 No.1806 Rotating Golem
ユーザー ma_twma_tw
提出日時 2022-01-21 19:11:40
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,454 bytes
コンパイル時間 2,331 ms
コンパイル使用メモリ 209,168 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 09:16:23
合計ジャッジ時間 2,594 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vpll = vector<pair<ll,ll>>;
using vs = vector<string>;
using pll = pair<ll,ll>;
#define fi first
#define se second
#define fore(p,a) for (auto p : a)
#define rep(i,n) for(ll i=0; i<(ll)(n); ++i)
#define rrep(i,n) for(ll i=(n); i>=0; --i)
#define repb(i,a,n) for(ll i=a; i<(ll)(n); ++i)
#define all(container) begin(container), end(container)
#define rall(container) rbegin(container), rend(container)
const ll INF = 1LL << 60;
const double PI = 3.141592653589793238462643383279;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll fact(ll x) { return x == 0 ? 1 : x * fact(x - 1); }
ll comb(ll n, ll r) { if (r == 0 || r == n) return 1; else if (r == 1) return n; return comb(n - 1, r - 1) + comb(n - 1, r); }
void prfl(double x) { printf("%.15f\n", x); }
bool ise(ll x) { return x % 2 == 0; }
bool dv(ll x, ll y) { return x % y == 0; }
int ci(char c) { return c - '0'; }
char ic(int i) { return '0' + i; }
bool isl(char c) { return 'a' <= c && c <= 'z'; }
bool isu(char c) { return 'A' <= c && c <= 'Z'; }

int main() {
    char a, b; cin >> a >> b;
    map<char,ll> mp;
    mp['N'] = 0;
    mp['E'] = 1;
    mp['S'] = 2;
    mp['W'] = 3;
    cout << (mp[b] - mp[a] + 4) % 4 << endl;
}
0