Created
September 18, 2023 02:06
-
-
Save PDPENG/49a195ff012080f46d7eaebe11e449b7 to your computer and use it in GitHub Desktop.
2023 ICPC Asia EC Online Qualifier Round 1, Problem L.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdlib.h> | |
using namespace std; | |
int main() | |
{ | |
long long int program_num; | |
long long int *program_data; | |
int time_limit, k; | |
cin >> program_num; | |
cin >> time_limit; | |
program_data = (long long int*)malloc(sizeof(long long int) * program_num); | |
if (program_num == 0 || time_limit > 100000) { | |
return 0; | |
} | |
for (int i = 0; i < program_num; i++) { | |
cin>>program_data[i]; | |
} | |
long long int max = program_data[0]; | |
for (int i = 1; i <= program_num; i++) { | |
if (program_data[i] > max) | |
max = program_data[i]; | |
} | |
for (int j = 2;; j++) { | |
if (j * time_limit >= max) { | |
k = j; | |
break; | |
} | |
} | |
cout << k << endl; | |
free(program_data); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stupid solution.