結果
| 問題 | No.549 素材合成システム |
| コンテスト | |
| ユーザー |
greentea011
|
| 提出日時 | 2019-03-28 14:58:58 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 260 bytes |
| 記録 | |
| コンパイル時間 | 809 ms |
| コンパイル使用メモリ | 19,840 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-12 22:16:18 |
| 合計ジャッジ時間 | 2,561 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 44 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d",&c);
| ^~~~~~~~~~~~~~
ソースコード
#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);
}
greentea011