結果

問題 No.1806 Rotating Golem
ユーザー kou_kkk
提出日時 2024-03-27 22:12:09
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 2,528 ms
コンパイル使用メモリ 61,776 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-09-30 14:36:41
合計ジャッジ時間 3,318 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

const
  xs = ["E", "S", "W", "N", "E", "S", "W"]

let
  a, b = readLine stdin
var
  flg = false
  cnt: int

for x in xs:
  if x == a:
    cnt = 0
    flg = true
    
  if flg:
    if x == b:
      echo cnt
      quit()
  
  inc cnt
0