Submission #40888

# Submission time Handle Problem Language Result Execution time Memory
40888 2018-02-09T18:44:50 Z XmtosX Igra (COCI17_igra) C++14
10 / 100
94 ms 780 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]);
            }
        }
    }
    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])
            {
                swap(s1[i],s1[j]);
                break;
            }
        }
    }
    cout <<s1;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Incorrect 2 ms 356 KB Output isn't correct
3 Incorrect 2 ms 464 KB Output isn't correct
4 Correct 2 ms 576 KB Output is correct
5 Incorrect 1 ms 576 KB Output isn't correct
6 Incorrect 1 ms 616 KB Output isn't correct
7 Incorrect 2 ms 636 KB Output isn't correct
8 Incorrect 2 ms 724 KB Output isn't correct
9 Incorrect 92 ms 748 KB Output isn't correct
10 Incorrect 94 ms 780 KB Output isn't correct