Skip to content

Commit

Permalink
Add 14584.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Jun 28, 2024
1 parent 842aab7 commit 3414a0e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions 14xxx/14584.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <iostream>
#include <string>
#include <vector>
using namespace std;

string solve(void) {
string s; cin >> s;
int n; cin >> n;
vector<string> v(n);
for (int i=0; i<n; i++) cin >> v[i];

for (int i=0; i<26; i++) {
for (int j=0; j<n; j++) {
if (s.find(v[j]) != string::npos) return s;
}
for (char &c : s) {
c = (c - 'a' + 1) % 26 + 'a';
}
}
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);

cout << solve();
return 0;
}

0 comments on commit 3414a0e

Please sign in to comment.