結果

問題 No.2314 Backflip
ユーザー elphe
提出日時 2025-03-31 19:07:10
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 954 ms
コンパイル使用メモリ 78,124 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-31 19:07:12
合計ジャッジ時間 1,962 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

static inline const string& solve(string& S)
{
	if (S.back() == '0') S.back() = '1';
	else S.back() = '0';

	return S;
}

int main()
{
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	
	string S;
	S.reserve(8);
	cin >> S;

	cout << solve(S) << '\n';
	return 0;
}
0