# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
673571 | WebbWayne | Igra (COCI17_igra) | C++17 | 1099 ms | 212 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < b; i++)
bool checker(string temp, string word) {
rep(i, 0, temp.size()) {
if(temp[i] == word[i])
return true;
}
return false;
}
int main() {
int n;
cin>>n;
vector<char> letter(n);
rep(i, 0, n) {
cin>>letter[i];
}
string word;
cin>>word;
string temp = word;
sort(temp.begin(), temp.end());
do {
next_permutation(temp.begin(), temp.end());
}while(checker(temp, word));
cout<<temp<<endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |