結果

問題 No.1806 Rotating Golem
ユーザー Digwee_kkknDigwee_kkkn
提出日時 2022-01-14 21:39:43
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,002 bytes
コンパイル時間 1,520 ms
コンパイル使用メモリ 164,128 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-12 18:26:00
合計ジャッジ時間 2,454 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,384 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>  
#define _USE_MATH_DEFINES       
using namespace std;  
typedef long long ll;  typedef float fl; typedef double db; typedef bool bl; 
typedef string st;  typedef pair<int,int> P; typedef int itn;
const int INF=100000000;  const ll INFx=1000000000000; ll MOD=1000000007;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1}; int DX[8]={0,-1,-1,-1,0,1,1,1} , DY[8]={1,1,0,-1,-1,-1,0,1}; 
string fi="01234567890123456789"; string al="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; string AL="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ";
int factorial(int i){return i ? factorial(i-1)*i:1;};    
#define rep(i,n) for(int i=0;i<(n);++i)  
#define YesNo(flag) if(flag){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

st c="NESWNESW";
int main(){
 char a,b; cin>>a>>b;
 itn res=0; bl flag=false;
 rep(i,8){
   if(c[i]==a)flag=true;
   if(flag&&c[i]!=b)res++;
   else if(flag) break;
 }
 cout<<res;

}
                                                                                
0