結果
| 問題 | No.632 穴埋め門松列 |
| コンテスト | |
| ユーザー |
mitsuwar
|
| 提出日時 | 2019-08-24 17:55:39 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 495 bytes |
| 記録 | |
| コンパイル時間 | 962 ms |
| コンパイル使用メモリ | 173,336 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-01 23:20:55 |
| 合計ジャッジ時間 | 1,843 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:44:24: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
44 | cout << ans << "\n";
| ^~~~
main.cpp:14:13: note: 'ans' was declared here
14 | int ans;
| ^~~
ソースコード
#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";
}
mitsuwar