結果

問題 No.920 あかあお
ユーザー himohimo
提出日時 2019-11-12 16:27:38
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 1,332 ms
コンパイル使用メモリ 159,572 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-10-19 07:31:33
合計ジャッジ時間 4,784 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

int main(){
  int a,b,c;
  cin >> a >>b >> c;
  int  ans =0;
  while(a>0&&b>0){
      a--;
      b--;
      ans++;
  }
    while(c>0){
        if(a==1&&b==1){
            a--;
            b--;
            ans++;
            
        }
        if(a==0){
            c--;
            a++;
        }
        else if( b==0){
            c--;
            b++;
        }
    }
    
    cout << ans << endl;
}
0