結果

問題 No.920 あかあお
ユーザー Wataruaoki
提出日時 2019-11-08 23:38:49
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 255 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 26,624 KB
最終ジャッジ日時 2025-01-08 03:15:59
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:3:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    3 |     int x, y, z; scanf("%d%d%d", &x, &y, &z);
      |                  ~~~~~^~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main(void){
    int x, y, z; scanf("%d%d%d", &x, &y, &z);
    if(x > y) {int tmp = x; y = x;}
    int res = x; y -= x;
    int d = y > z ? z : y; res += d;
    y -= d; z -= d; res += (z / 2);
    printf("%d\n", res);
    return 0;
}
0