# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
580827 |
2022-06-21T23:49:09 Z |
PaNNiiiiC |
Igra (COCI17_igra) |
C++17 |
|
1 ms |
212 KB |
#include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main(){
fast;
int n;cin>>n;
string s,t;cin>>s>>t;
sort(s.begin(),s.end());
int last=0;
for(int i=0;i<n-1;i++)
if(s[i]==t[i])
{swap(s[i],s[s.find_first_not_of(s[i],last)]);last=i;}
if(s[n-1]==t[n-1])
swap(s[n-1],s[s.find_last_not_of(s[n-1])]);
cout<<s<<'\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |