Skip to content

Instantly share code, notes, and snippets.

@PDPENG
Created September 18, 2023 02:06
Show Gist options
  • Save PDPENG/49a195ff012080f46d7eaebe11e449b7 to your computer and use it in GitHub Desktop.
Save PDPENG/49a195ff012080f46d7eaebe11e449b7 to your computer and use it in GitHub Desktop.
2023 ICPC Asia EC Online Qualifier Round 1, Problem L.
#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;
}
@PDPENG
Copy link
Author

PDPENG commented Sep 18, 2023

Stupid solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment