結果
問題 |
No.1806 Rotating Golem
|
ユーザー |
![]() |
提出日時 | 2022-01-14 21:40:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 707 bytes |
コンパイル時間 | 1,566 ms |
コンパイル使用メモリ | 166,292 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-20 08:43:52 |
合計ジャッジ時間 | 2,259 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll,ll> P; typedef vector<ll> VI; typedef vector<VI> VVI; #define REP(i,n) for(ll i=0;i<(n);i++) #define ALL(v) v.begin(),v.end() template<typename T> bool chmax(T &x, const T &y) {return (x<y)?(x=y,true):false;}; template<typename T> bool chmin(T &x, const T &y) {return (x>y)?(x=y,true):false;}; constexpr ll MOD=998244353; constexpr ll INF=2e18; int main(){ char a, b; cin >> a >> b; string s="NESW"; int ans=0, f=0; for(int i=0;1;i++){ if(f) ans++; if(s[i%4]==a&&!f) f=1; if(s[i%4]==b&&f) break; } cout << ans << endl; return 0; }