# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
40889 |
2018-02-09T18:51:03 Z |
XmtosX |
Igra (COCI17_igra) |
C++14 |
|
94 ms |
728 KB |
#include <bits/stdc++.h>
using namespace std;
int n;
string s1,s2;
int main()
{
cin >>n>>s1>>s2;
for (int i=0;i<n;i++)
{
for (int j=i+1;j<n;j++)
{
if (s1[i]!=s2[j]&&s1[j]!=s2[i])
{
if (s1[i]==s2[i])
swap(s1[i],s1[j]);
else if (s1[i]>s1[j])
swap(s1[i],s1[j]);
}
}
}
int pos=n-1;
if (s1[n-1]==s2[n-1])
{
for (int i=n-1;i>=0;i--)
{
int j=n-1;
if (s1[i]!=s2[j]&&s1[j]!=s2[i])
{
if (s1[i]>s1[j])
pos=i;
else if (pos==n-1)
pos=i;
}
}
}
swap(s1[n-1],s1[pos]);
cout <<s1;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
248 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
352 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
424 KB |
Output isn't correct |
4 |
Correct |
1 ms |
440 KB |
Output is correct |
5 |
Incorrect |
1 ms |
496 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
496 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
512 KB |
Output isn't correct |
8 |
Incorrect |
3 ms |
548 KB |
Output isn't correct |
9 |
Incorrect |
94 ms |
728 KB |
Output isn't correct |
10 |
Incorrect |
92 ms |
728 KB |
Output isn't correct |