답안 #580824

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
580824 2022-06-21T23:29:53 Z PaNNiiiiC Igra (COCI17_igra) C++17
10 / 100
2 ms 468 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());
        for(int i=0;i<n-1;i++)
            if(s[i]==t[i])
                swap(s[i],s[s.find_first_not_of(s[i],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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 1 ms 468 KB Execution killed with signal 6
3 Runtime error 1 ms 468 KB Execution killed with signal 6
4 Runtime error 1 ms 468 KB Execution killed with signal 6
5 Runtime error 1 ms 468 KB Execution killed with signal 6
6 Runtime error 1 ms 468 KB Execution killed with signal 6
7 Runtime error 1 ms 468 KB Execution killed with signal 6
8 Runtime error 1 ms 468 KB Execution killed with signal 6
9 Runtime error 2 ms 468 KB Execution killed with signal 6
10 Runtime error 2 ms 468 KB Execution killed with signal 6