結果
問題 | No.1806 Rotating Golem |
ユーザー |
![]() |
提出日時 | 2022-01-14 21:39:43 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,002 bytes |
コンパイル時間 | 1,621 ms |
コンパイル使用メモリ | 166,704 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-20 08:43:39 |
合計ジャッジ時間 | 2,179 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h>#define _USE_MATH_DEFINESusing 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;}