結果

問題 No.1362 [Zelkova 8th Tune] Black Sheep
ユーザー kkkk97368086
提出日時 2021-12-09 13:06:42
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 13 ms / 1,000 ms
コード長 442 bytes
コンパイル時間 1,568 ms
コンパイル使用メモリ 167,352 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-17 06:40:50
合計ジャッジ時間 3,901 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;


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

	int N = S.size();
	if( S[0] == S[1] && S[1] == S[2] ) {
		for( int i = 3; i < N; i++ ) {
			if( S[i] == S[0] ) continue;
			cout << i + 1 << " " << S[i] << endl;
		}
	}
	else {
		if( S[0] == S[1] ) cout << 3 << " " << S[2] << endl;
		else if( S[1] == S[2] ) cout << 1 << " " << S[0] << endl;
		else if( S[2] == S[0] ) cout << 2 << " " << S[1] << endl;
	}
}
0