結果

問題 No.2034 Anti Lexicography
ユーザー Md Shahinur RahmanMd Shahinur Rahman
提出日時 2022-08-12 22:33:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 696 bytes
コンパイル時間 1,623 ms
コンパイル使用メモリ 171,448 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2023-10-24 10:49:16
合計ジャッジ時間 2,597 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
5,952 KB
testcase_01 AC 4 ms
5,952 KB
testcase_02 AC 4 ms
5,956 KB
testcase_03 AC 3 ms
5,956 KB
testcase_04 AC 4 ms
5,952 KB
testcase_05 AC 23 ms
7,836 KB
testcase_06 AC 23 ms
7,844 KB
testcase_07 AC 22 ms
7,836 KB
testcase_08 AC 23 ms
7,844 KB
testcase_09 AC 23 ms
7,840 KB
testcase_10 AC 23 ms
7,844 KB
testcase_11 AC 24 ms
7,844 KB
testcase_12 AC 23 ms
7,844 KB
testcase_13 AC 4 ms
5,996 KB
testcase_14 AC 4 ms
5,996 KB
testcase_15 AC 4 ms
6,024 KB
testcase_16 AC 4 ms
6,076 KB
testcase_17 AC 4 ms
6,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define itsmdshahin		  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll                long long
#define MX				  1000006
const int N = 100100;
using namespace std;
vector<ll>g[N];
int main()
{
    itsmdshahin;
    ll n,z=0;
    cin >> n;
    vector<ll>a;
    string t="abcdefghijklmnopqrstuvwxyz",s;cin >> s;
    for(int j=0;j<s.size();j++){
      for(int i=t.size()-1;i>=0;i--){
         if(s[j]==t[i]){
            a.push_back(i);
         }
      }
    }
    reverse(t.begin(),t.end());
    for(int j=0;j<a.size();j++){
      for(int i=0;i<t.size();i++){
         if(a[j]==i){
            cout << t[i];
         }
      }
    }
    cout << endl;

}


0