結果

問題 No.920 あかあお
ユーザー Kaso_uKaso_u
提出日時 2019-11-08 21:53:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 428 bytes
コンパイル時間 1,950 ms
コンパイル使用メモリ 164,428 KB
実行使用メモリ 11,944 KB
最終ジャッジ日時 2023-10-13 03:48:14
合計ジャッジ時間 8,030 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int convert_murasaki(int, int, int)’ 内:
main.cpp:19:1: 警告: 非 void を戻す関数内に return 文がありません [-Wreturn-type]
   19 | }
      | ^

ソースコード

diff #

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

int convert_murasaki(int x,int y,int z){
    int cnt=0;
  	cnt+=min(x,y);
  	x-=y;
  	y=0;
	if(x>=z){
      cnt+=z;
    }
    else{
      cnt+=x;
      z-=x;
      x=0;
      cnt+=(z/2);
    }
  	cout << cnt << endl;
}

int main(){
  int x,y,z;
  int cnt;
  cin >> x >> y >> z;
  
  if(x>y){
    convert_murasaki(x,y,z);
  }
  else{
    convert_murasaki(y,x,z);
  }
  
  return 0;
}
0