結果

問題 No.920 あかあお
ユーザー courange_coucourange_cou
提出日時 2020-01-12 12:09:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 631 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 30,708 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-08-19 02:17:10
合計ジャッジ時間 1,500 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
int main(){
   int X,Y,Z,ans=0;
   scanf("%d %d %d",&X,&Y,&Z);
   if(X>Y){
      if((X-Y)<Z){
         Z -= X-Y;
         Y = X;
         printf("パターン1\n");
      }else{
         ans = Y+Z;
         printf("パターン2\n");
      }
   }else if(Y>X){
      if((Y-X)<Z){
         Z -= Y-X;
         X = Y;
         printf("パターン3\n");
      }else{
         ans = X+Z;
         printf("パターン4\n");
      }
   }
   printf("X:%d\nY:%d\nZ:%d\n",X,Y,Z);
   if(X == Y){
      if(Z % 2 == 1)ans += (Z-1)/2+X;
      else ans += Z/2+X;
      printf("パターン5\n");
   }
   printf("%d\n",ans);
}
0