結果

問題 No.1806 Rotating Golem
ユーザー ygd.ygd.
提出日時 2022-01-14 21:40:43
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 636 bytes
コンパイル時間 414 ms
コンパイル使用メモリ 10,540 KB
実行使用メモリ 8,472 KB
最終ジャッジ日時 2023-08-12 18:29:22
合計ジャッジ時間 1,204 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,324 KB
testcase_01 AC 18 ms
8,424 KB
testcase_02 AC 18 ms
8,396 KB
testcase_03 AC 18 ms
8,432 KB
testcase_04 AC 18 ms
8,452 KB
testcase_05 AC 19 ms
8,288 KB
testcase_06 AC 18 ms
8,364 KB
testcase_07 AC 18 ms
8,336 KB
testcase_08 AC 18 ms
8,292 KB
testcase_09 AC 17 ms
8,372 KB
testcase_10 AC 17 ms
8,372 KB
testcase_11 AC 18 ms
8,420 KB
testcase_12 AC 18 ms
8,324 KB
testcase_13 AC 18 ms
8,372 KB
testcase_14 AC 18 ms
8,472 KB
testcase_15 AC 18 ms
8,376 KB
権限があれば一括ダウンロードができます

ソースコード

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