結果

問題 No.1806 Rotating Golem
ユーザー yuzu32ut
提出日時 2022-03-14 00:43:10
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 5,882 ms
コンパイル使用メモリ 125,184 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 08:33:08
合計ジャッジ時間 4,979 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
using namespace std;

int main() {
    map<char, int> table;
    table['N'] = 0;
    table['E'] = 1;
    table['S'] = 2;
    table['W'] = 3;

    char a, b;
    cin >> a;
    cin >> b;

    auto ans = (table[b] + 4 - table[a]) % 4;
    cout << ans << endl;
}
0