結果
| 問題 | No.3035 文字列のみの反転 |
| コンテスト | |
| ユーザー |
Tatsu_mr
|
| 提出日時 | 2025-02-28 21:22:06 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 768 bytes |
| 記録 | |
| コンパイル時間 | 2,022 ms |
| コンパイル使用メモリ | 331,616 KB |
| 実行使用メモリ | 9,204 KB |
| 最終ジャッジ日時 | 2026-07-06 11:26:49 |
| 合計ジャッジ時間 | 3,092 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/bits/stl_algobase.h:67,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/algorithm:62,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/x86_64-pc-linux-gnu/bits/stdc++.h:53,
from main.cpp:1:
In member function 'constexpr __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container>::operator+(difference_type) const [with _Iterator = char*; _Container = std::__cxx11::basic_string<char>]',
inlined from 'int main()' at main.cpp:34:12:
/home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/bits/stl_iterator.h:1148:47: warning: 'id' may be used uninitialized [-Wmaybe-uninitialized]
1148 | { return __normal_iterator(_M_current + __n); }
| ^~~
main.cpp: In function 'int main()':
main.cpp:27:9: note: 'id' was declared here
27 | int id;
| ^~
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define For(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, n) For(i, 0, n)
#define rFor(i, a, b) for(int i = (a); i >= (b); i--)
#define ALL(v) (v).begin(), (v).end()
#define rALL(v) (v).rbegin(), (v).rend()
using lint = long long;
using ld = long double;
int INF = 2000000000;
lint LINF = 1000000000000000000;
struct SetupIo {
SetupIo() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
}
} setupio;
int main() {
string s;
cin >> s;
int id;
rep(i, int(s.size())) {
if ('0' <= s[i] && s[i] <= '9') {
id = i;
break;
}
}
reverse(s.begin(), s.begin() + id);
cout << s << "\n";
}
Tatsu_mr