結果
| 問題 | 
                            No.920 あかあお
                             | 
                    
| コンテスト | |
| ユーザー | 
                             courange_cou
                         | 
                    
| 提出日時 | 2020-01-12 12:09:38 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 643 bytes | 
| コンパイル時間 | 127 ms | 
| コンパイル使用メモリ | 30,976 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-28 15:02:28 | 
| 合計ジャッジ時間 | 782 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 11 | 
ソースコード
#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);
}
            
            
            
        
            
courange_cou