# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
673570 | WebbWayne | Igra (COCI17_igra) | C++14 | 1093 ms | 308 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < b; i++)
bool checker(string temp, string word) {
rep(i, 0, temp.size()) {
if(temp[i] == word[i])
return true;
}
return false;
}
int main() {
int n;
cin>>n;
vector<char> letter(n);
rep(i, 0, n) {
cin>>letter[i];
}
string word;
cin>>word;
string temp = word;
sort(temp.begin(), temp.end());
do {
next_permutation(temp.begin(), temp.end());
}while(checker(temp, word));
cout<<temp<<endl;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |