# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1107306 | vjudge1 | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++17 | 1 ms | 336 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nn "\n";
#define pb push_back
#define all(v) (v).begin() , (v).end()
const int N = 2e4+ 4;
int n , T , q , m ;
signed main(){
cin>> n ;
string s ;
cin>> s ;
vector<pair<int , string>>v;
for(int i=0 ; i < ( 1 << n ) - 1; i++){
string t = s;
int c =0 ;
for(int j =0 ; j < s.size()- 1 ; j++){
if(( i >> j )&1 ){
swap(t[j] , t[j+1]);
c++;
}
}
int ok =0 ;
for(int j=0 ; j < t.size() - 1; j++){
if(t[j]==t[j+1]){
ok = 1;
break;
}
}
if(!ok)v.pb({c , t});
}
if(!v.size())cout <<-1;
sort(all(v));
for(auto it:v){
cout <<it.first << ' ' << it.second << nn
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |