結果

問題 No.1806 Rotating Golem
コンテスト
ユーザー keisuke6
提出日時 2022-08-07 23:29:57
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 332µs
コード長 755 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,004 ms
コンパイル使用メモリ 330,568 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-29 16:09:36
合計ジャッジ時間 3,275 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  string S = "NESW";
  char a,b;
  cin>>a>>b;
  if(a == 'N'){
      if(b == 'N') cout<<0<<endl;
      if(b == 'E') cout<<1<<endl;
      if(b == 'S') cout<<2<<endl;
      if(b == 'W') cout<<3<<endl;
  }
  if(a == 'E'){
      if(b == 'N') cout<<3<<endl;
      if(b == 'E') cout<<0<<endl;
      if(b == 'S') cout<<1<<endl;
      if(b == 'W') cout<<2<<endl;
  }
  if(a == 'S'){
      if(b == 'N') cout<<2<<endl;
      if(b == 'E') cout<<3<<endl;
      if(b == 'S') cout<<0<<endl;
      if(b == 'W') cout<<1<<endl;
  }
  if(a == 'W'){
      if(b == 'N') cout<<1<<endl;
      if(b == 'E') cout<<2<<endl;
      if(b == 'S') cout<<3<<endl;
      if(b == 'W') cout<<0<<endl;
  }
}
0