結果
問題 |
No.3035 文字列のみの反転
|
ユーザー |
|
提出日時 | 2025-02-28 22:17:32 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 2,720 ms |
コンパイル使用メモリ | 274,568 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-02-28 22:17:43 |
合計ジャッジ時間 | 3,263 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); string S; cin >> S; int i = 0; while(i < S.size() && !('0' <= S[i] && S[i] <= '9')) i++; string B = S.substr(i); string A = S.substr(0, i); reverse(A.begin(), A.end()); cout << A << B << "\n"; }