結果
問題 | No.2228 Creeping Ghost |
ユーザー |
|
提出日時 | 2023-02-24 22:51:23 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 1,333 bytes |
コンパイル時間 | 2,475 ms |
コンパイル使用メモリ | 70,120 KB |
最終ジャッジ日時 | 2025-02-10 22:01:32 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 7 |
ソースコード
#include<iostream>#include<vector>using namespace std;using ll=long long;#define rep(i,n) for(int i=0;i<n;i++)#define rrep(i,n) for(int i=(n)-1;i>=0;i--)#define all(v) v.begin(),v.end()#define rall(v) v.rbegin(),v.rend()template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;}template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;}int main(){ios::sync_with_stdio(false);cin.tie(nullptr);int t;cin>>t;string s="";bool flag=true;rep(q,t){if(flag){if(q%12>=8){if(q%4==0)s+='D';else if(q%4==1)s+='D';else if(q%4==2)s+='R';else s+='R';}else{if(q%4==0)s+='D';else if(q%4==1)s+='U';else if(q%4==2)s+='R';else s+='D';}}else{if(q%12>=8){if(q%4==0)s+='U';else if(q%4==1)s+='U';else if(q%4==2)s+='L';else s+='L';}else{if(q%4==0)s+='U';else if(q%4==1)s+='D';else if(q%4==2)s+='L';else s+='U';}}if(q%12==11)flag=!flag;}cout<<s<<"\n";}