結果

問題 No.587 七対子
ユーザー CPpoint
提出日時 2017-11-03 22:53:41
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 517 bytes
コンパイル時間 416 ms
コンパイル使用メモリ 53,980 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-22 16:14:08
合計ジャッジ時間 1,417 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
	char s[13];
	char c1 = 'N';
	char c2 = 'N';
	int OK = 1;
	for (int i = 0; i != 13; i++) {
		cin >> s[i];
		for (int j = 0; j != i; j++) {
			if (s[i] == s[j]) {
				OK = 0;
				s[i] == 'N';
				s[j] == 'N';
				break;
			}
		}
		if (OK == 1 && c1 == 'N') {
			c1 = s[i];
		}
		else if (OK == 1 && c2 == 'N') {
			c2 = s[i];
		}
		else {
			OK = 1;
		}
	}
	if (c1 != 'N' && c2 != 'N') {
		cout << "Inpossible\n";
		return 0;
	}
	cout << c1 << '\n';

	return 0;
}
0