# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
580821 | 2022-06-21T22:53:25 Z | Metal_Sonic | Igra (COCI17_igra) | C++17 | 1000 ms | 316 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #define sz(x) (int)(x).size() #define all(x) x.begin() , x.end() void setIO(string name = "") { ios_base::sync_with_stdio(false); cin.tie(nullptr); if(sz(name)){ freopen((name+".in").c_str(), "r", stdin); freopen((name+".out").c_str(), "w", stdout); } } void run_test_case(){ int n;cin>>n; string s , m;cin>>s>>m; string ans = s; sort(all(ans)); do { bool f = true; for (int i = 0; i < n; i++) if (ans[i] == m[i]) { f = false; break; } if (f) { cout << ans; exit(0); } } while(next_permutation(all(ans))); } int main() { setIO(); int T = 1; while(T--){ run_test_case(); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 4 ms | 212 KB | Output is correct |
3 | Correct | 16 ms | 316 KB | Output is correct |
4 | Correct | 237 ms | 300 KB | Output is correct |
5 | Execution timed out | 1089 ms | 212 KB | Time limit exceeded |
6 | Execution timed out | 1093 ms | 212 KB | Time limit exceeded |
7 | Execution timed out | 1089 ms | 212 KB | Time limit exceeded |
8 | Execution timed out | 1091 ms | 212 KB | Time limit exceeded |
9 | Execution timed out | 1085 ms | 212 KB | Time limit exceeded |
10 | Execution timed out | 1081 ms | 212 KB | Time limit exceeded |