#41521: c++提示


yp11351280@yphs.tp.edu.tw (710-43韓睿哲)

School : 臺北市私立延平高級中學
ID : 276272
IP address : [118.168.99.41]
Last Login :
2025-04-19 22:56:38
m396. 煲仔飯 (ClayPotRice) -- TOI練習賽202310新手組第1題 | From: [114.24.170.52] | Post Date : 2024-08-03 12:39

要注意:a要加1後再和b+c+d+e的值去比,因為如果a=b+c+d+e,時間還是夠的。以下為重點處程式碼

  int a, b, c, d, e;
  cin>>a>>b>>c>>d>>e;
  (a>b+c+d+e)?cout<<b+c+d+e:cout<<"-1";

 
ZeroJudge Forum