結果

問題 No.1806 Rotating Golem
ユーザー ygd.
提出日時 2022-01-14 21:40:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 636 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-20 08:46:31
合計ジャッジ時間 1,366 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline #文字列につけてはダメ
#input = sys.stdin.buffer.readline #文字列につけてはダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
from collections import defaultdict 
#from collections import deque
#import copy
#import math
#from functools import lru_cache
#MOD = pow(10,9) + 7
#MOD = 998244353


def main():
    A = input()
    B = input()
    L = ['N', 'E', 'S', 'W']
    a = L.index(A)
    b = L.index(B)
    ans = b - a
    if ans < 0: ans += 4
    print(ans)

if __name__ == '__main__':
    main()
0