結果

問題 No.632 穴埋め門松列
ユーザー mitsuwar
提出日時 2019-08-24 17:55:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 495 bytes
コンパイル時間 1,239 ms
コンパイル使用メモリ 157,264 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-14 13:06:20
合計ジャッジ時間 1,657 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:44:24: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   44 |         cout << ans << "\n";
      |                        ^~~~

ソースコード

diff #

#include "bits/stdc++.h"

typedef long long ll;

using namespace std;
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
//  --------------------------------------

	char c[3];
	for(int i = 0; i < 3; i++) cin >> c[i];

	int ans;
	if (c[0] == '?')
	{
		if (c[1] == '2')
		{
			ans = 4;
		}else
		{
			ans = 1;
		}
		
		
	}
	else if (c[1] == '?')
	{
		ans = 14;
	}
	else if (c[2] == '?')
	{
		if (c[1] == '2')
		{
			ans = 4;
		}
		else
		{
			ans = 1;
		}
		
	}
	
	cout << ans << "\n";

}
0