Editorial for Обиколка


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.
by:

Тестовете можете да видите тук.

Примерно решение на C++:

#include<iostream>
using namespace std;

int n;
int c,m,r;
int mt=0;
double maxs=0;
int d;


int main()
{
  cin >> n;
  for(int i=1;i<=n;i++)
  {
    cin >> c >> m >> r;
    mt = mt + 60*c + m;
    double ms=(double)r/(60*c+m);
    if(ms>maxs) {maxs=ms; d=i;}
  }

  int d0=mt/(24*60);
  mt = mt % (24*60);
  int c0 = mt/60;
  mt = mt%60;

  cout << d0 << " " << c0 << " " << mt << " " << d << endl;
}

Comments

There are no comments at the moment.