結果

問題 No.1806 Rotating Golem
コンテスト
ユーザー kou_kkk
提出日時 2024-03-27 22:12:09
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 231 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,976 ms
コンパイル使用メモリ 65,688 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-16 17:38:44
合計ジャッジ時間 3,079 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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