結果

問題 No.632 穴埋め門松列
ユーザー ajiruajiruajiruajiru
提出日時 2020-02-06 02:22:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 645 bytes
コンパイル時間 581 ms
コンパイル使用メモリ 68,692 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 18:48:51
合計ジャッジ時間 1,151 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(void) {
	vector<int> one(3), four(3);
	char c;
	for (int i = 0; i < 3; ++i) {
		cin >> c;
		if (c == '2')
			one[i] = 2, four[i] = 2;
		else if (c == '3')
			one[i] = 3, four[i] = 3;
		else
			one[i] = 1, four[i] = 4;
	}
	bool ok1 = false, ok4 = false;
	if ((one[1] > one[0] && one[1] > one[2])
		|| (one[1] < one[0] && one[1] < one[2]))
		ok1 = true;
	if ((four[1] > four[0] && four[1] > four[2])
		|| (four[1] < four[0] && four[1] < four[2]))
		ok4 = true;

	if (ok1 && ok4) cout << 14 << endl;
	else if (ok1) cout << 1 << endl;
	else if (ok4) cout << 4 << endl;
	return 0;
}
0