結果

問題 No.1806 Rotating Golem
ユーザー LV3zJigVW57oPGy
提出日時 2022-08-16 18:41:47
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 1,494 ms
コンパイル使用メモリ 158,712 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-03 10:23:36
合計ジャッジ時間 1,776 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string a, b;
  int count=0;
  cin >> a >>b;
  while(true){
    if(a=="N"&&a!=b){
      a="E";
    }
    else if(a==b){
      break;
    }
    else{
      if(a=="E"&&a!=b){
      a="S";
      }
      else{
        if(a=="S"&&a!=b){
      	a="W";
      	}
        else{
           if(a=="W"&&a!=b){
      		a="N";
      		}
        }
      }
    }
    count++;
  }
  cout << count;
}
    
0