Submission
| Id | When | Author | Problem | Language | CPU | Memory | Verdict |
|---|---|---|---|---|---|---|---|
| 12020 | 2023-11-29 16:31:56 | fahimx51 | Akash and Cipher |
|
1 ms | 3440 kb | Wrong Answer - 3 |
Test Cases
| CPU | Memory | Verdict | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 ms | 3380 kb | Accepted | ||||||||
| 2 | 1 ms | 3288 kb | Accepted | ||||||||
| 3 | 1 ms | 3440 kb | Wrong Answer | ||||||||
| 4 | - | - | Skipped | ||||||||
| 5 | - | - | Skipped | ||||||||
| 6 | - | - | Skipped | ||||||||
Source Code
program.cpp
#include <iostream> #include <vector> #include <map> #include <set> #include <algorithm> using namespace std; #define ll long long #define nl "\n" const int mod = (int) 1000000007; const int N = (int) 1000006; #define INF 2147483647 #define drop(s) cout << #s << "\n" #define ext exit(0) #define vtr vector <int> #define st set <int> #define mp map <int, int> #define mem(arr, n) memset(arr, n, sizeof(arr)) #define sz(x) (int)x.size() #define pb push_back #define fs first #define sc second #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define fr(i, a, b) for (int i = (a); i < (int)(b); ++i) #define takeinp(a, n) for(int i=0; i<n; i++) cin>>a[i] #define print(a, n) for(int i=0; i<n; i++) cout<<a[i]<<" "; cout<<"\n"; #define gcd(x, y) __gcd(x,y) #define lcm(a, b) a*(b/gcd(a, b)) #define setBit(n) __builtin_popcount(n) #define secIndxSorter(p, n) sort(p, p+n,[](const pair<int, int>& lhs, const pair<int, int>& rhs) {return lhs.second < rhs.second;}); #define yes cout<<"YES\n" #define no cout<<"NO\n" #define optimize ios_base::sync_with_stdio(false); cin.tie(0); struct{ template<class T> operator T() { T x; cin >> x; return x; } }in; void onlineJudge(){ #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif } void solve() { int n = in; string s = in, dir = in; string ans = ""; for(int i=0; i<n; i++) { int indx = i+1; indx %= 26; if(dir[i]=='U') { int x = indx + s[i]; if(x<=122) { ans += x; } else { x -= 122; x += 96; ans += x; } } else { int x = s[i] - indx; if(x>=97) { ans += x; } else { x = 97 - x; // cout<<"x is "<<x<<nl; x -= 123; ans += x; } } } cout<<ans<<nl; } int main() { optimize; int T; cin>>T; for(int i=1; i<=T; i++) { solve(); } return 0; }