f160. 1. 音檔剪輯 - 高中生程式解題系統

PHOTO EMBED

Tue Oct 27 2020 02:55:57 GMT+0000 (Coordinated Universal Time)

Saved by @Lokwong #c++

5 8
1 4 6 8 12 15 16 18
content_copyCOPY

#include <iostream> using namespace std; int main(){ int t = 0, n = 0; cin >> t >> n ; int* arr = new int[n]; for ( int i = 0; i < n; i++){ cin >> arr[i]; } float out = arr[n-1]/t; int com = arr[n-1]/t; if( out > com ){ cout << com+1; } else if ( out == com) cout << com; return 0; }

https://zerojudge.tw/ShowProblem?problemid