結果

問題 No.2041 E-mail Address
ユーザー warm4C0
提出日時 2023-05-07 17:19:01
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 1,524 ms
コンパイル使用メモリ 159,832 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-24 16:33:03
合計ジャッジ時間 2,031 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
	string s;
	cin >> s;

	string ans = "";
	bool ok = true;
	for (int i = 0; i < s.size(); i++) {
		if (ok && s[i] == '(') {
			ok = false;
			ans += '@';
		}
		if (ok) {
			ans += s[i];
		}
		if (!ok && s[i] == ')') {
			ok = true;
		}
	}

	cout << ans << endl;

	return 0;
}
0