結果

問題 No.927 Second Permutation
ユーザー MJXzkibvOFVxZkx
提出日時 2019-11-22 21:36:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,043 bytes
コンパイル時間 762 ms
コンパイル使用メモリ 88,852 KB
実行使用メモリ 13,632 KB
最終ジャッジ日時 2024-10-11 02:59:19
合計ジャッジ時間 7,232 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other WA * 7 TLE * 2 -- * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    int si=s.size();
    for(int i=0;i<si;i++){
        for(int j=i+1;j<si;j++){
            if(s[i]<s[j]){
                swap(s[i],s[j]);
            }
        }
}
    swap(s[si-1],s[si-2]);
cout<<s<<'\n';
	return 0;
}
0