結果
問題 | No.632 穴埋め門松列 |
ユーザー |
![]() |
提出日時 | 2018-01-28 01:07:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 561 bytes |
コンパイル時間 | 1,875 ms |
コンパイル使用メモリ | 165,956 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 07:18:42 |
合計ジャッジ時間 | 2,434 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:23:13: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized] 23 | cout << ans << endl; | ^~~ main.cpp:13:9: note: 'ans' was declared here 13 | int ans; | ^~~
ソースコード
#include <math.h> #include <ctype.h> #include <bits/stdc++.h> using namespace std; #define FOR(i, a, n) for (int i = a; i < n; i++) #define REP(i, n) for(int i = 0; i < n; i++) struct omt{omt(){ios::sync_with_stdio(false);cin.tie(0);}}star; int main(){ char C[3]; REP(i, 3) 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 << endl; return 0; }