fork(1) download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. void function(long int *tab,string *tab_n, long int n) {
  6. long int temp_max = tab[0];
  7. for (long int i = 0; i < n; i++) {
  8. if (tab[i] < temp_max) {
  9. temp_max = tab[i];
  10. }
  11. }
  12. for (long int b = 0; b < n; b++) {
  13. if (tab[b] == temp_max) {
  14. cout << tab_n[b] << endl;
  15. }
  16. }
  17. }
  18. int main() {
  19. long int a;
  20. long int *tab;
  21. string *tab_n;
  22. string number;
  23. getline(cin, number);
  24. a = stol(number);
  25. tab = new long int[a];
  26. tab_n = new string[a];
  27.  
  28. for (long int b = 0; b < a; b++) {
  29. string line;
  30. int temp = 0;
  31. getline(cin, line);
  32. string line_1;
  33. string line_2;
  34. string line_3;
  35. line_1 = line.substr(line.length() - 5, 2);
  36. line_2 = line.substr(line.length() - 2, 2);
  37. line_3 = line.substr(0, line.length() - 6);
  38. int line_1i = stoi(line_1);
  39. int line_2i = stoi(line_2);
  40. long int line_c = 100 * line_1i + line_2i;
  41. tab[b] = line_c;
  42. tab_n[b] = line_3;
  43.  
  44. }
  45. function(tab, tab_n, a);
  46.  
  47. // your code goes here
  48. return 0;
  49. }
Success #stdin #stdout 0s 3468KB
stdin
10
Adam Bak 22:52
Piotr Kakol 19:18
Marcin Kasprowicz 21:14
Mieczyslaw Bejnar 8:14
Mariusz Sliwinski 23:02
Witold Dlugosz 20:12
Maciej Boniecki 8:14
Arkadiusz Nowaczynski 19:59
Jaroslaw Konczak 22:00
Bartek Kraska 22:52
stdout
Mieczyslaw Bejna
Maciej Bonieck