結果
| 問題 |
No.676 C0nvertPr0b1em
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-10 04:20:05 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 434 bytes |
| コンパイル時間 | 2,868 ms |
| コンパイル使用メモリ | 192,288 KB |
| 最終ジャッジ日時 | 2025-01-14 09:07:50 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void replaceIfAll(string &s, char c1, char c2, char c3) {
std::replace_if(
s.begin(), s.end(),
[&c1, &c2, &c3](auto x) { return x == c1 or x == c2; }, c3);
}
void solve() {
string s;
cin >> s;
replaceIfAll(s, 'I', 'l', '1');
replaceIfAll(s, 'O', 'o', '0');
cout << s << endl;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
solve();
getchar();
}