結果
問題 |
No.549 素材合成システム
|
ユーザー |
![]() |
提出日時 | 2019-03-28 14:56:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 260 bytes |
コンパイル時間 | 223 ms |
コンパイル使用メモリ | 30,720 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 22:12:47 |
合計ジャッジ時間 | 1,983 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 44 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:14:23: warning: 'max' may be used uninitialized [-Wmaybe-uninitialized] 14 | ans+=(max>>1)+(max&0x1); | ~~~~^~~~~ main.cpp:6:9: note: 'max' was declared here 6 | int max; | ^~~ main.cpp:14:8: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized] 14 | ans+=(max>>1)+(max&0x1); | ~~~^~~~~~~~~~~~~~~~~~~~ main.cpp:5:9: note: 'ans' was declared here 5 | int ans; | ^~~
ソースコード
#include <stdio.h> int main(){ int n; int ans; int max; int c; scanf("%d",&n); for (int i=0;i<n;i++) { scanf("%d",&c); max=(c>max)?c:max; ans+=(c>>1); } ans+=(max>>1)+(max&0x1); printf("%d\n",ans); }