fork(1) download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iomanip>
  4. using namespace std;
  5. int main() {
  6. float n, m, x, MAX = 0, max , cnt;
  7. bool have = false;
  8. ifstream fin("starzi.in");
  9. ofstream fout("strazi.out");
  10. cin >> n;
  11. for(int i = 1; i <= n ; i++) {
  12. cin >> m;
  13. max = 0; cnt = 0;
  14. for(int j = 1; j <= m; j++) {
  15. cin >> x;
  16. if(x > max) {
  17. cnt++;
  18. max = x;
  19. }
  20. }
  21. cout << fixed << setprecision(3) << (double)cnt / m;
  22. cout << '\n';
  23. if(cnt / m == 1 && !have) {
  24. MAX = i;
  25. have = true;
  26. }
  27. }
  28. cout << (int)MAX;
  29. }
  30.  
Success #stdin #stdout 0.01s 5292KB
stdin
4
5 5.1 7.2 2.0 6.9 8.3 
3 6.5 4.2 3.1
2 3.4 5.0
4 1.2 2.3 3.4 4.5
stdout
0.600
0.333
1.000
1.000
3