結果

問題 No.1806 Rotating Golem
ユーザー koryoukoryou
提出日時 2022-01-14 21:29:32
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,187 bytes
コンパイル時間 1,038 ms
コンパイル使用メモリ 98,360 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-12 17:42:04
合計ジャッジ時間 2,063 ms
ジャッジサーバーID
(参考情報)
judge7 / judge10
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <string>
#include <list>
#include <cassert>
#include <numeric>
#include <cstdint>
#include <queue>
#include <deque>
#include <stack>
#include <set>
// #include <atcoder/all>
 
using ll = long long;
using ld = long double;
using namespace std;
// using namespace atcoder;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using Priority = priority_queue<ll, vector<ll>, greater<ll>>;// 昇順
using Priority_pair = priority_queue<P, vector<P>, greater<P>>;
// using mint_17 = modint1000000007;
// using mint = modint998244353;

// typedef pair<int,int> P;
#define mod 1000000007
#define MAX_WIDTH 60
#define MAX_HEIGHT 60
#define INF 1e18
#define MOD 998244353
#define PI 3.141592653589793

char A, B;
string S = "ESWN";
int main(){
    cin >> A >> B;

    ll now = 0;
    map<char, int> rel;
    for(int i=0;i<4;i++) {
        rel[S[i]] = i;
        if(S[i] == A) now = i;
    }

    ll cnt = 0;
    while(1) {
        if(S[now % 4] == B) {
            cout << cnt << endl;
            return 0;
        }
        now++;
        cnt++;
    }

    return 0;
}
0