結果

問題 No.3035 文字列のみの反転
ユーザー 北杜七星
提出日時 2025-02-28 21:25:31
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 3,650 ms
コンパイル使用メモリ 316,188 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-28 21:25:36
合計ジャッジ時間 4,347 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (ll)(n); i++)
#define all(a) (a).begin(), (a).end()
using ll = long long;
const int INF32 = 2e9;
const ll INF64 = 4e18;

int main() {
    string S;
    cin >> S;
    string A="", B="";
    int i = 0;
    for(; i < S.size(); i++){
        if('0'<=S[i]&&S[i]<='9')break;
        A+=S[i];
    }
    for(; i < S.size(); i++){
        B+=S[i];
    }
    reverse(all(A));
    cout << A << B << endl;
    return 0;
}
0