結果
問題 |
No.3035 文字列のみの反転
|
ユーザー |
![]() |
提出日時 | 2025-02-28 21:21:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,074 bytes |
コンパイル時間 | 4,138 ms |
コンパイル使用メモリ | 251,596 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-28 21:21:50 |
合計ジャッジ時間 | 4,646 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
#ifdef LOCAL #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using namespace std; #define ll long long #define rep(i,n) for(ll i=0;i<(ll)n;i++) #define all(v) v.begin(),v.end() const ll INF = (ll)2e18; /* 素数判定(エラトステネス) 下処理O(NloglogN) 実行O(1) pをtureにしp*p以上のpの倍数をfalseに N以下の自然数がprimeかを表す配列を返す関数 */ vector<bool> make_is_prime(int N) { vector<bool> prime(N + 1, true); prime[0] = false; prime[1] = false; for (int i = 2; i * i <= N; i++) { if (!prime[i]) continue; for (int j = i * i; j <= N; j += i) { prime[j] = false; } } return prime; } int main(){ cin.tie(0); ios::sync_with_stdio(false); string S; cin >> S; string A = ""; string B = ""; rep(i,S.size()){ if('a'<=S[i]&&S[i]<='z'){ A += S[i]; } else{ B += S[i]; } } reverse(all(A)); cout << A << B << endl; }